]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/Main.qc
only send armor/health updates as increments of 10
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / Main.qc
index 03cbd528a2cf3cbf983ef500bc57edcaf3addee3..4fca767dfc05a3be7bd7fc0b4be68b0854aca089 100644 (file)
@@ -654,6 +654,10 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
 
 // --------------------------------------------------------------------------
 // BEGIN OPTIONAL CSQC FUNCTIONS
+void Ent_RemoveEntCS()
+{
+       entcs_receiver[self.sv_entnum] = world;
+}
 void Ent_ReadEntCS()
 {
        InterpolateOrigin_Undo();
@@ -664,7 +668,9 @@ void Ent_ReadEntCS()
        self.origin_y = ReadShort();
        self.origin_z = ReadShort();
        self.angles_y = ReadByte() * 360.0 / 256;
-       self.origin_z = self.angles_x = self.angles_z = 0;
+       self.angles_x = self.angles_z = 0;
+       entcs_receiver[self.sv_entnum] = self;
+       self.entremove = Ent_RemoveEntCS;
 
        InterpolateOrigin_Note();
 }
@@ -897,26 +903,21 @@ void Ent_ShowNames()
     // entity init, TODO can this be done only once somehow?
     self.the_entnum = ReadByte(); // TODO: fixme to only send once somehow
     self.draw2d = Draw_ShowNames;
+
     //self.movetype = MOVETYPE_FLY; // movetype needed so we can traceline?
-    self.mins = '-20 -20 -24';
-    self.maxs = '20 20 45';
+    //self.mins = '-20 -20 -24';
+    //self.maxs = '20 20 45';
     self.classname = "shownames_tag";
 
     sf = ReadByte();
 
     if(sf & 1)
     {
-        self.origin_x = ReadShort();
-        self.origin_y = ReadShort();
-        self.origin_z = ReadShort();
+        self.healthvalue = ReadByte() * 10;
     }
     if(sf & 2)
     {
-        self.healthvalue = ReadByte();
-    }
-    if(sf & 4)
-    {
-        self.armorvalue = ReadByte();
+        self.armorvalue = ReadByte() * 10;
     }
 
     if(sf & 128) // same team