}
}
-.float health, armorvalue;
+.float healthvalue, armorvalue;
void Ent_ShowNames()
{
float sf, the_entnum;
sf = ReadByte();
the_entnum = ReadByte();
- print("sendflags: ", ftos(sf), "\n");
if(sf & 1)
{
- playerslots[the_entnum].origin_x = ReadShort();
- playerslots[the_entnum].origin_y = ReadShort();
- playerslots[the_entnum].origin_z = ReadShort();
- print("Updated origin = ", vtos(playerslots[the_entnum].origin), " for player ", GetPlayerName(the_entnum-1), "\n");
- print("Their health/armor = ", playerslots[the_entnum].health, "/", playerslots[the_entnum].armorvalue, "\n");
+ playerslots[the_entnum-1].origin_x = ReadShort();
+ playerslots[the_entnum-1].origin_y = ReadShort();
+ playerslots[the_entnum-1].origin_z = ReadShort();
}
if(sf & 2)
{
- playerslots[the_entnum].health = ReadByte();
- playerslots[the_entnum].armorvalue = ReadByte();
+ playerslots[the_entnum-1].healthvalue = ReadByte();
+ playerslots[the_entnum-1].armorvalue = ReadByte();
}
/*
float SendEntity_ShowNames(entity to, float sendflags)
{
if(vlen(to.origin - self.origin) < autocvar_sv_shownames_cull_distance) // distance cull
- return;
+ return FALSE;
WriteByte(MSG_ENTITY, ENT_CLIENT_SHOWNAMES);
- //sendflags &= 127;
- if(teams_matter && self.team == to.team)
+ sendflags = sendflags & 127;
+ if(teams_matter && self.owner.team == to.team)
sendflags |= 128;
else
sendflags &~= 2;
setorigin(self, self.owner.origin);
self.SendFlags |= 1;
}
- if(self.health != self.owner.health || self.armorvalue != self.owner.armorvalue)
+ if(self.health != floor(self.owner.health) || self.armorvalue != floor(self.owner.armorvalue))
{
- self.health = self.owner.health;
- self.armorvalue = self.owner.armorvalue;
+ self.health = floor(self.owner.health);
+ self.armorvalue = floor(self.owner.armorvalue);
self.SendFlags |= 2;
}
if(self.the_entnum != num_for_edict(self.owner))