void entcs_init()
{
print("Initializing ClientSide information entities\n");
-};
+}
float entcs_customize()
{
return FALSE;
if(other == o)
return FALSE;
- if(other.classname == "player")
- if(o.team != other.team)
+ if((other.classname == "player") || other.caplayer)
+ if(!teamplay || o.team != other.team)
if not (radar_showennemies)
return FALSE;
return TRUE;
float entcs_send(entity to, float sf)
{
- sf |= 128;
- if(teams_matter && !radar_showennemies)
- if(to.team != self.team)
- sf &~= (8 | 16 | 128); // don't send h/a for enemies
-
WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
WriteByte(MSG_ENTITY, sf);
if(sf & 1)
- WriteByte(MSG_ENTITY, num_for_edict(self.owner));
+ WriteByte(MSG_ENTITY, num_for_edict(self.owner)-1);
if(sf & 2)
{
WriteShort(MSG_ENTITY, self.origin_x);
if(sf & 16)
WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
return TRUE;
-};
+}
void entcs_think()
{
- self.nextthink = time;
+ self.nextthink = time + 0.033333333333; // increase this to like 0.15 once the client can do smoothing
entity o;
o = self.owner;
self.armorvalue = o.armorvalue;
self.SendFlags |= 16;
}
-};
+}
entity attach_entcs()
{
- local entity ent;
+ entity ent;
ent = spawn();
ent.classname = "entcs_sender_v2";
self.entcs = ent;
return ent;
-};
+}
void detach_entcs()
{
remove(self.entcs);
self.entcs = world;
-};
+}