3 float entcs_customize()
7 if(o.deadflag != DEAD_NO)
13 if((IS_PLAYER(other)) || other.caplayer)
14 if(!teamplay || o.team != other.team)
15 if (!radar_showennemies)
20 bool entcs_send(entity this, entity to, int sf)
22 WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
23 WriteByte(MSG_ENTITY, sf);
25 WriteByte(MSG_ENTITY, num_for_edict(self.owner) - 1);
28 WriteShort(MSG_ENTITY, self.origin.x);
29 WriteShort(MSG_ENTITY, self.origin.y);
30 WriteShort(MSG_ENTITY, self.origin.z);
33 WriteByte(MSG_ENTITY, self.angles.y * 256.0 / 360);
35 WriteByte(MSG_ENTITY, self.health / 10); // FIXME use a better scale?
37 WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
44 self.nextthink = time + 0.033333333333; // increase this to like 0.15 once the client can do smoothing
45 entity o = self.owner;
46 if (o.origin != self.origin)
48 setorigin(self, o.origin);
49 self.SendFlags |= BIT(1);
51 if (o.angles.y != self.angles.y)
53 self.angles = o.angles;
54 self.SendFlags |= BIT(2);
56 if (o.health != self.health)
58 self.health = o.health;
59 self.SendFlags |= BIT(3);
61 if (o.armorvalue != self.armorvalue)
63 self.armorvalue = o.armorvalue;
64 self.SendFlags |= BIT(4);
68 entity attach_entcs(entity e)
70 entity ent = e.entcs = new(entcs_sender);
72 ent.think = entcs_think;
75 Net_LinkEntity(ent, false, 0, entcs_send);
76 ent.customizeentityforclient = entcs_customize;
81 void detach_entcs(entity e)