From 2e1b2846da0cd5880938e02bb44de32971636fe5 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Mon, 6 Apr 2020 11:14:40 +0200 Subject: [PATCH] Some prediction fixes? --- src/client/predict.c | 16 +++------------- src/shared/pmove.c | 6 +++--- src/shared/valve/w_snark.c | 5 ----- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/client/predict.c b/src/client/predict.c index 2e72866e..d15a3be6 100644 --- a/src/client/predict.c +++ b/src/client/predict.c @@ -45,20 +45,10 @@ void Predict_PreFrame(player pl) /*for (; self.pmove_frame <= servercommandframe; self.pmove_frame++) { float flSuccess = getinputstate(self.pmove_frame);*/ for ( int i = pl.sequence + 1; i <= clientcommandframe; i++ ) { - float flSuccess = getinputstate( i ); + if (!getinputstate(i)) { + break; //erk?... too old? + } input_sequence = i; - if (flSuccess == FALSE) { - continue; - } - - if (i==clientcommandframe){ - CSQC_Input_Frame(); - } - - // Partial frames are the worst - if (input_timelength == 0) { - break; - } QPhysics_Run(pl); } } diff --git a/src/shared/pmove.c b/src/shared/pmove.c index fdd4243a..7474db5c 100644 --- a/src/shared/pmove.c +++ b/src/shared/pmove.c @@ -793,6 +793,9 @@ PMove_Run(void) self.basevelocity = [0,0,0]; self.groundentity = __NULL__; + /* activate any SOLID_TRIGGER entities */ + touchtriggers(); + /* timers, these are predicted and shared across client and server */ pl.w_attack_next = max(0, pl.w_attack_next - input_timelength); pl.w_idle_next = max(0, pl.w_idle_next - input_timelength); @@ -804,7 +807,4 @@ PMove_Run(void) /* weapon/item logic of what the player controls */ Game_Input(); - - /* activate any SOLID_TRIGGER entities */ - touchtriggers(); } diff --git a/src/shared/valve/w_snark.c b/src/shared/valve/w_snark.c index a9614692..76d1c64d 100644 --- a/src/shared/valve/w_snark.c +++ b/src/shared/valve/w_snark.c @@ -155,10 +155,6 @@ void w_snark_draw(void) { Weapons_SetModel("models/v_squeak.mdl"); Weapons_ViewAnimation(SNARK_DRAW); -#ifdef SSQC - player pl = (player)self; - Weapons_UpdateAmmo(pl, __NULL__, pl.ammo_snark, __NULL__); -#endif } void w_snark_holster(void) @@ -201,7 +197,6 @@ void w_snark_primary(void) #else w_snark_deploy(); pl.ammo_snark--; - Weapons_UpdateAmmo(pl, __NULL__, pl.ammo_snark, __NULL__); if (pl.a_ammo2 <= 0) { Weapons_RemoveItem(pl, WEAPON_SNARK);