CLIENT: Network more important client fields

This commit is contained in:
cypress 2023-11-12 10:46:49 -05:00
parent 3ec7db8299
commit fb40427c3c
5 changed files with 11 additions and 2 deletions

View file

@ -1551,7 +1551,8 @@ void(float width, float height) HUD_PlayerNames =
float player_number = getplayerkeyfloat(i, "viewentity");
string text = getplayerkeyvalue(i, "name");
vector player_origin = getentity(player_number, GE_ORIGIN) + '0 0 48';
entity plr = findfloat(world, playernum, player_number);
vector player_origin = plr.origin + '0 0 48';
vector screen_position = project(player_origin);
vector text_color = '1 1 1';

View file

@ -591,8 +591,12 @@ noref void(float isnew) CSQC_Ent_Update =
self.velocity_x = readshort();
self.velocity_y = readshort();
self.velocity_z = readshort();
self.playernum = readfloat();
self.model = readstring();
self.movetype = readshort();
self.flags = readfloat();
setmodel(self, self.model);
setsize(self, [-16, -16, -32], [16, 16, 40]);
setorigin(self, self.origin);
} else {

View file

@ -554,6 +554,9 @@ float Player_SendEntity( entity ePVEnt, float flChanged ) {
WriteShort( MSG_ENTITY, self.velocity_x ); // Velocity X
WriteShort( MSG_ENTITY, self.velocity_y ); // Velocity X
WriteShort( MSG_ENTITY, self.velocity_z ); // Velocity X
WriteFloat( MSG_ENTITY, self.playernum ); // Player ID
WriteString( MSG_ENTITY, self.model ); // Player Model
WriteShort( MSG_ENTITY, self.movetype ); // Player Movetype
WriteFloat( MSG_ENTITY, self.flags ); // Flags, important for physics
return TRUE;
}

View file

@ -78,7 +78,6 @@ float global_trace_damage_multiplier;
.float lastsound_time;
.float isspec;
string mappath;
.float playernum;
.float ads_toggle;
float player_count;
entity pl1;

View file

@ -227,6 +227,8 @@ const float EVENT_LIMBGIB = 44;
#define STAT_FACINGENEMY 66
#define STAT_MAXHEALTH 67
.float playernum;
//
// invert float takes in float value between 0 and 1, inverts position
// eg: 0.1 returns 0.9, 0.34 returns 0.66