4 float entcs_customize()
8 if(o.deadflag != DEAD_NO)
14 if((IS_PLAYER(other)) || other.caplayer)
15 if(!teamplay || o.team != other.team)
16 if (!radar_showennemies)
21 bool entcs_send(entity this, entity to, int sf)
23 WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
24 WriteByte(MSG_ENTITY, sf);
26 WriteByte(MSG_ENTITY, num_for_edict(self.owner) - 1);
29 WriteShort(MSG_ENTITY, self.origin.x);
30 WriteShort(MSG_ENTITY, self.origin.y);
31 WriteShort(MSG_ENTITY, self.origin.z);
34 WriteByte(MSG_ENTITY, self.angles.y * 256.0 / 360);
36 WriteByte(MSG_ENTITY, self.health / 10); // FIXME use a better scale?
38 WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
45 self.nextthink = time + 0.033333333333; // increase this to like 0.15 once the client can do smoothing
46 entity o = self.owner;
47 if (o.origin != self.origin)
49 setorigin(self, o.origin);
50 self.SendFlags |= BIT(1);
52 if (o.angles.y != self.angles.y)
54 self.angles = o.angles;
55 self.SendFlags |= BIT(2);
57 if (o.health != self.health)
59 self.health = o.health;
60 self.SendFlags |= BIT(3);
62 if (o.armorvalue != self.armorvalue)
64 self.armorvalue = o.armorvalue;
65 self.SendFlags |= BIT(4);
69 entity attach_entcs(entity e)
71 entity ent = e.entcs = new(entcs_sender);
73 ent.think = entcs_think;
76 Net_LinkEntity(ent, false, 0, entcs_send);
77 ent.customizeentityforclient = entcs_customize;
82 void detach_entcs(entity e)