Prediction: Propagate jumptime and teleport_time

This commit is contained in:
Marco Cawthorne 2019-03-25 01:49:27 +01:00
parent 7e46202f7b
commit b1ccc9fbb1
19 changed files with 24 additions and 3 deletions

View File

@ -45,5 +45,7 @@ void Player_ReadEntity(float flIsNew)
pl.movetype = readfloat();
pl.view_ofs[2] = readfloat();
pl.viewzoom = readfloat();
pl.jumptime = readfloat();
pl.teleport_time = readfloat();
setorigin( pl, pl.origin );
}

View File

@ -20,6 +20,8 @@ void Predict_PreFrame(player pl)
pl.netorigin = pl.origin;
pl.netvelocity = pl.velocity;
pl.netflags = pl.flags;
pl.netjumptime = pl.jumptime;
pl.netteleport_time = pl.teleport_time;
//self.netpmove_flags = self.pmove_flags;
@ -58,6 +60,8 @@ void Predict_PostFrame(player pl)
pl.origin = pl.netorigin;
pl.velocity = pl.netvelocity;
pl.flags = pl.netflags;
pl.jumptime = pl.netjumptime;
pl.teleport_time = pl.netteleport_time;
//self.pmove_flags = self.netpmove_flags;
setorigin(pl, pl.origin);

View File

@ -37,6 +37,8 @@ void Player_ReadEntity(float flIsNew)
pl.movetype = readfloat();
pl.view_ofs[2] = readfloat();
pl.viewzoom = readfloat();
pl.jumptime = readfloat();
pl.teleport_time = readfloat();
pl.a_ammo1 = readbyte();
pl.a_ammo2 = readbyte();
pl.a_ammo3 = readbyte();

View File

@ -60,3 +60,6 @@ const vector VEC_PLAYER_CVIEWPOS = [0,0,12];
#define FL_FLASHLIGHT (1<<21)
#define clamp(d,min,max) bound(min,d,max)
.float jumptime;
.float teleport_time;

View File

@ -68,6 +68,8 @@ float Player_SendEntity(entity ePEnt, float fChanged)
WriteFloat(MSG_ENTITY, self.movetype);
WriteFloat(MSG_ENTITY, self.view_ofs[2]);
WriteFloat(MSG_ENTITY, self.viewzoom);
WriteFloat(MSG_ENTITY, self.jumptime);
WriteFloat(MSG_ENTITY, self.teleport_time);
return TRUE;
}

View File

@ -109,6 +109,8 @@ float Player_SendEntity(entity ePEnt, float fChanged)
WriteFloat(MSG_ENTITY, pl.movetype);
WriteFloat(MSG_ENTITY, pl.view_ofs[2]);
WriteFloat(MSG_ENTITY, pl.viewzoom);
WriteFloat(MSG_ENTITY, pl.jumptime);
WriteFloat(MSG_ENTITY, pl.teleport_time);
WriteByte(MSG_ENTITY, pl.a_ammo1);
WriteByte(MSG_ENTITY, pl.a_ammo2);

View File

@ -8,6 +8,8 @@ class player
vector netorigin;
vector netvelocity;
float netflags;
float netjumptime;
float netteleport_time;
float activeweapon;
float weapons;

View File

@ -13,10 +13,8 @@
#define PHY_JUMP_CHAINDECAY 50
/*FIXME: jumptime should use the time global, as time intervals are not predictable - decrement it based upon input_timelength*/
.float jumptime;
.float waterlevel;
.float watertype;
.float teleport_time;
.float maxspeed;
.vector view_ofs;
int trace_endcontentsi;
@ -27,6 +25,7 @@ PMove_Init
=================
*/
void PMove_Init(void) {
#ifdef SSQC
localcmd("serverinfo phy_stepheight 18\n");
localcmd("serverinfo phy_airstepheight 18\n");
localcmd("serverinfo phy_friction 4\n");
@ -43,6 +42,7 @@ void PMove_Init(void) {
localcmd("serverinfo phy_accelerate 8\n");
localcmd("serverinfo phy_maxspeed 270\n");
#endif
#endif
}
/*
@ -190,7 +190,7 @@ void PMove_WaterMove(void)
}
if (!(self.flags & FL_WATERJUMP)) {
self.velocity = self.velocity - 0.8 * self.waterlevel * frametime * self.velocity;
self.velocity = self.velocity - 0.8 * self.waterlevel * input_timelength * self.velocity;
}
}

View File

@ -48,6 +48,8 @@ class player
float netflags;
float net_w_attack_next;
float net_w_idle_next;
float netjumptime;
float netteleport_time;
virtual void() gun_offset;
virtual void() draw;

View File

@ -47,6 +47,8 @@ class player
float netflags;
float net_w_attack_next;
float net_w_idle_next;
float netjumptime;
float netteleport_time;
virtual void() gun_offset;
virtual void() draw;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.