race_laptime = 0;
race_checkpointtime = 0;
}
+ if (autocvar_hud_panel_healtharmor_progressbar_gfx)
+ {
+ if ( (spectatee_status == -1 && newspectatee_status > 0) //before observing, now spectating
+ || (spectatee_status > 0 && newspectatee_status > 0 && spectatee_status != newspectatee_status) //changed spectated player
+ )
+ prev_p_health = -1;
+ else if(spectatee_status && !newspectatee_status) //before observing/spectating, now playing
+ prev_health = -1;
+ }
spectatee_status = newspectatee_status;
}
}
}
-.float health, armorvalue;
void Ent_ShowNames()
{
- float sf, the_entnum;
+ float sf;
+
+ // 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';
sf = ReadByte();
- the_entnum = ReadByte();
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 # ", ftos(the_entnum), "\n");
+ self.origin_x = ReadShort();
+ self.origin_y = ReadShort();
+ self.origin_z = ReadShort();
}
if(sf & 2)
{
- playerslots[the_entnum].health = ReadByte();
- playerslots[the_entnum].armorvalue = ReadByte();
- print("Updated health/armor = ", ftos(playerslots[the_entnum].health), "/", ftos(playerslots[the_entnum].health), " for player # ", ftos(the_entnum), "\n");
+ self.healthvalue = ReadByte();
+ self.armorvalue = ReadByte();
}
- if(sf & 4)
- playerslots[the_entnum].netname = ReadString();
- /*
- string thename;
- float thehealth, thearmor;
-
- if(shownames_netname)
- strunzone(shownames_netname);
- thename = strzone(ReadString());
- thehealth = ReadByte();
- thearmor = ReadByte();
-
- if(autocvar_hud_panel_shownames == 1 && thehealth > 0) // teammates only
- {
- shownames_netname = thename;
- shownames_health = thehealth;
- shownames_armor = thearmor;
-
- shownames_time = time + autocvar_hud_panel_shownames_sustain;
- }
- else if(autocvar_hud_panel_shownames == 2)
- {
- shownames_netname = thename;
- shownames_health = thehealth;
- shownames_armor = thearmor;
-
- shownames_time = time + autocvar_hud_panel_shownames_sustain;
- }
- */
+ if(sf & 128) // same team
+ self.sameteam = TRUE;
+ else
+ self.sameteam = FALSE;
}
// CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.