From: Mario Date: Sat, 15 Jul 2017 17:40:22 +0000 (+1000) Subject: Make the clientstate entity a parameter of PM_UpdateButtons X-Git-Tag: xonotic-v0.8.5~2630 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=664e533adeb2c905f01f955983e60ea0517626f4;p=xonotic%2Fxonotic-data.pk3dir.git Make the clientstate entity a parameter of PM_UpdateButtons --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 2dbc7bbcd..de408f1b9 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -820,7 +820,7 @@ void CSQC_ClientMovement_PlayerMove_Frame(entity this) { #ifdef SVQC // needs to be called before physics are run! - PM_UpdateButtons(this); + PM_UpdateButtons(this, CS(this)); #endif sys_phys_update(this, PHYS_INPUT_TIMELENGTH); diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index 1e94bec57..ad7cff228 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -244,7 +244,7 @@ STATIC_INIT(PHYS_INPUT_BUTTON_DODGE) void Physics_UpdateStats(entity this, float maxspd_mod); - void PM_UpdateButtons(entity this); + void PM_UpdateButtons(entity this, entity store); .float stat_sv_airspeedlimit_nonqw = _STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW); .float stat_sv_maxspeed = _STAT(MOVEVARS_MAXSPEED); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 11833b8c9..b091105e6 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2747,39 +2747,39 @@ void PlayerPostThink (entity this) } // hack to copy the button fields from the client entity to the Client State -void PM_UpdateButtons(entity this) +void PM_UpdateButtons(entity this, entity store) { if(this.impulse) - CS(this).impulse = this.impulse; + store.impulse = this.impulse; this.impulse = 0; - CS(this).button0 = this.button0; - CS(this).button2 = this.button2; - CS(this).button3 = this.button3; - CS(this).button4 = this.button4; - CS(this).button5 = this.button5; - CS(this).button6 = this.button6; - CS(this).button7 = this.button7; - CS(this).button8 = this.button8; - CS(this).button9 = this.button9; - CS(this).button10 = this.button10; - CS(this).button11 = this.button11; - CS(this).button12 = this.button12; - CS(this).button13 = this.button13; - CS(this).button14 = this.button14; - CS(this).button15 = this.button15; - CS(this).button16 = this.button16; - CS(this).buttonuse = this.buttonuse; - CS(this).buttonchat = this.buttonchat; - - CS(this).cursor_active = this.cursor_active; - CS(this).cursor_screen = this.cursor_screen; - CS(this).cursor_trace_start = this.cursor_trace_start; - CS(this).cursor_trace_endpos = this.cursor_trace_endpos; - CS(this).cursor_trace_ent = this.cursor_trace_ent; + store.button0 = this.button0; + store.button2 = this.button2; + store.button3 = this.button3; + store.button4 = this.button4; + store.button5 = this.button5; + store.button6 = this.button6; + store.button7 = this.button7; + store.button8 = this.button8; + store.button9 = this.button9; + store.button10 = this.button10; + store.button11 = this.button11; + store.button12 = this.button12; + store.button13 = this.button13; + store.button14 = this.button14; + store.button15 = this.button15; + store.button16 = this.button16; + store.buttonuse = this.buttonuse; + store.buttonchat = this.buttonchat; + + store.cursor_active = this.cursor_active; + store.cursor_screen = this.cursor_screen; + store.cursor_trace_start = this.cursor_trace_start; + store.cursor_trace_endpos = this.cursor_trace_endpos; + store.cursor_trace_ent = this.cursor_trace_ent; // TODO: ping? - CS(this).v_angle = this.v_angle; - CS(this).movement = this.movement; + store.v_angle = this.v_angle; + store.movement = this.movement; }