3 #include "mutators/gamemode_ca.qh"
5 float entcs_customize()
9 if(o.deadflag != DEAD_NO)
15 if((IS_PLAYER(other)) || other.caplayer)
16 if(!teamplay || o.team != other.team)
17 if (!radar_showennemies)
22 bool entcs_send(entity this, entity to, int sf)
24 WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
25 WriteByte(MSG_ENTITY, sf);
27 WriteByte(MSG_ENTITY, num_for_edict(self.owner) - 1);
30 WriteShort(MSG_ENTITY, self.origin.x);
31 WriteShort(MSG_ENTITY, self.origin.y);
32 WriteShort(MSG_ENTITY, self.origin.z);
35 WriteByte(MSG_ENTITY, self.angles.y * 256.0 / 360);
37 WriteByte(MSG_ENTITY, self.health / 10); // FIXME use a better scale?
39 WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
46 self.nextthink = time + 0.033333333333; // increase this to like 0.15 once the client can do smoothing
47 entity o = self.owner;
48 if (o.origin != self.origin)
50 setorigin(self, o.origin);
51 self.SendFlags |= BIT(1);
53 if (o.angles.y != self.angles.y)
55 self.angles = o.angles;
56 self.SendFlags |= BIT(2);
58 if (o.health != self.health)
60 self.health = o.health;
61 self.SendFlags |= BIT(3);
63 if (o.armorvalue != self.armorvalue)
65 self.armorvalue = o.armorvalue;
66 self.SendFlags |= BIT(4);
70 entity attach_entcs(entity e)
72 entity ent = e.entcs = new(entcs_sender);
74 ent.think = entcs_think;
77 Net_LinkEntity(ent, false, 0, entcs_send);
78 ent.customizeentityforclient = entcs_customize;
83 void detach_entcs(entity e)