From 289b0a089c8bd38eb795d0c5271fe7efca68c910 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 27 Sep 2020 16:00:06 +1000 Subject: [PATCH] - SW: Do 19fd0331d401a4e8fd4a3425e916193c968d0297 in a better way. * Will still need to review SOs and synchronised input. It would be good to be able to run them unsynchronised like the turret. --- source/sw/src/draw.cpp | 2 +- source/sw/src/player.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index ecf4d8fdd..56c526dff 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -1645,7 +1645,7 @@ drawscreen(PLAYERp pp, double smoothratio) // Interpolate the player's angle while on a sector object, just like VoidSW. // This isn't needed for the turret as it was fixable, but moving sector objects are problematic. - if (cl_syncinput || pp != Player+myconnectindex || (!cl_syncinput && pp->sop && !TEST(pp->Flags2, PF2_INPUT_CAN_TURN_TURRET))) + if (cl_syncinput || pp != Player+myconnectindex) { fixed_t dang = IntToFixed(1024); fixed_t oang = camerapp->oq16ang + camerapp->oq16look_ang; diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 32d125cb1..4355a6161 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -134,6 +134,9 @@ PLAYER Player[MAX_SW_PLAYERS_REG + 1]; short NormalVisibility; +// bool for determining whether game has set cl_syncinput or not. +static bool gamesetinput = false; + int InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity); SPRITEp FindNearSprite(SPRITEp sp, short stat); @@ -2832,6 +2835,9 @@ DoPlayerMoveVehicle(PLAYERp pp) PlaySOsound(pp->sop->mid_sector,SO_IDLE_SOUND); } + // force synchronised input here for now. + gamesetinput = cl_syncinput = true; + if (PLAYER_MOVING(pp) == 0) RESET(pp->Flags, PF_PLAYER_MOVED); else @@ -7296,6 +7302,12 @@ domovethings(void) RESET(pp->Flags2, PF2_INPUT_CAN_AIM|PF2_INPUT_CAN_TURN_GENERAL|PF2_INPUT_CAN_TURN_VEHICLE|PF2_INPUT_CAN_TURN_TURRET); resetinputhelpers(pp); + // disable synchronised input if set by game. + if (gamesetinput) + { + gamesetinput = cl_syncinput = false; + } + if (pp->DoPlayerAction) pp->DoPlayerAction(pp); UpdatePlayerSprite(pp);