Send / receive the predator entnum instead
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 00:04:17 +0000 (03:04 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 00:04:17 +0000 (03:04 +0300)
data/qcsrc/client/Main.qc
data/qcsrc/client/shownames.qc
data/qcsrc/client/shownames.qh
data/qcsrc/server/ent_cs.qc

index 48e137c993188163c34445da0e5c5a57bd142462..e7fd1ea24c25a91989d580c508e2538ed44205b0 100644 (file)
@@ -687,7 +687,7 @@ void Ent_ReadEntCS()
        if(sf & 16)\r
                self.armorvalue = ReadByte() * 10;\r
        if(sf & 32)\r
-               self.eaten = ReadByte();\r
+               self.predator = ReadByte();\r
 \r
        entcs_receiver[self.sv_entnum] = self;\r
        self.entremove = Ent_RemoveEntCS;\r
index 37bd0bfc6a0b7c41e63fc8834ca85c9f5fe1f016..fac602ee0f6a0ee44d568ccfca31398c5053eeef 100644 (file)
@@ -14,7 +14,7 @@ void Draw_ShowNames(entity ent)
        if(ent.sv_entnum == player_localentnum && !cvar("chase_active"))
                return;
 
-       if(ent.eaten) // don't show names for prey
+       if(ent.predator) // don't show names for prey
                return;
 
        if(ent.sameteam || (!ent.sameteam && cvar("hud_shownames_enemies")))
@@ -171,14 +171,14 @@ void Draw_ShowNames_All()
                        e.healthvalue = entcs.healthvalue;
                        e.armorvalue = entcs.armorvalue;
                        e.sameteam = 1; /* (teamplay && (t == myteam)); */
-                       e.eaten = entcs.eaten;
+                       e.predator = entcs.predator;
                }
                else
                {
                        e.healthvalue = 2342;
                        e.armorvalue = 0;
                        e.sameteam = 0;
-                       e.eaten = 0;
+                       e.predator = 0;
                }
 
                e.origin = getplayerorigin(i);
index fbd20f026f1c49c24bb47121dcbb5be80fb6d2da..0509dd3e195d68c531c945fd226d7fe872ba943c 100644 (file)
@@ -1,4 +1,4 @@
 .float healthvalue;
 .float armorvalue;
-.float eaten;
+.float predator;
 .float sameteam;
index 9f564b4ebca3484ee6e1d68610bfce7d715bcc7a..dfb8a4066dfa3159e373ba98a5f7677a25102482 100644 (file)
@@ -56,7 +56,7 @@ float entcs_send(entity to, float sf)
        if(sf & 16)\r
                WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?\r
        if(sf & 32)\r
-               WriteByte(MSG_ENTITY, self.stat_eaten);\r
+               WriteByte(MSG_ENTITY, num_for_edict(self.predator));\r
        return TRUE;\r
 };\r
 \r
@@ -87,9 +87,9 @@ void entcs_think()
                self.armorvalue = o.armorvalue;\r
                self.SendFlags |= 16;\r
        }\r
-       if(o.stat_eaten != self.stat_eaten)\r
+       if(o.predator != self.predator)\r
        {\r
-               self.stat_eaten = o.stat_eaten;\r
+               self.predator = o.predator;\r
                self.SendFlags |= 32;\r
        }\r
 };\r