-void TeamBubbleThink()
-{
- self.nextthink = time;
- if (!self.owner.modelindex || self.owner.teambubbleentity != self)
- {
- if(self.owner) // but why can that ever be world?
- self.owner.teambubbleentity = world;
- remove(self);
- return;
- }
-// setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1'); // bandwidth hog. setattachment does this now
- if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator)
- self.model = "";
- else
- self.model = self.mdl;
-
-};
-
-float TeamBubble_customizeentityforclient()
-{
- return (self.owner != other && self.owner.team == other.team && other.killcount > -666);
-}
-
-void UpdateTeamBubble()
-{
- if (!self.modelindex || !teams_matter)
- return;
- // spawn a teambubble entity if needed
- if (!self.teambubbleentity && teams_matter)
- {
- self.teambubbleentity = spawn();
- self.teambubbleentity.owner = self;
- self.teambubbleentity.exteriormodeltoclient = self;
- self.teambubbleentity.think = TeamBubbleThink;
- self.teambubbleentity.nextthink = time;
- setmodel(self.teambubbleentity, "models/misc/teambubble.spr"); // precision set below
-// setorigin(self.teambubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1');
- setorigin(self.teambubbleentity, '0 0 15' + self.maxs_z * '0 0 1');
- setattachment(self.teambubbleentity, self, ""); // sticks to moving player better, also conserves bandwidth
- self.teambubbleentity.mdl = self.teambubbleentity.model;
- self.teambubbleentity.model = self.teambubbleentity.mdl;
- self.teambubbleentity.customizeentityforclient = TeamBubble_customizeentityforclient;
- self.teambubbleentity.effects = EF_LOWPRECISION;
- }
-}
-