- SW: Do 19fd0331d4 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.
This commit is contained in:
Mitchell Richters 2020-09-27 16:00:06 +10:00
parent 9271444feb
commit 289b0a089c
2 changed files with 13 additions and 1 deletions

View file

@ -1645,7 +1645,7 @@ drawscreen(PLAYERp pp, double smoothratio)
// Interpolate the player's angle while on a sector object, just like VoidSW. // 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. // 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 dang = IntToFixed(1024);
fixed_t oang = camerapp->oq16ang + camerapp->oq16look_ang; fixed_t oang = camerapp->oq16ang + camerapp->oq16look_ang;

View file

@ -134,6 +134,9 @@ PLAYER Player[MAX_SW_PLAYERS_REG + 1];
short NormalVisibility; 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); int InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity);
SPRITEp FindNearSprite(SPRITEp sp, short stat); SPRITEp FindNearSprite(SPRITEp sp, short stat);
@ -2832,6 +2835,9 @@ DoPlayerMoveVehicle(PLAYERp pp)
PlaySOsound(pp->sop->mid_sector,SO_IDLE_SOUND); PlaySOsound(pp->sop->mid_sector,SO_IDLE_SOUND);
} }
// force synchronised input here for now.
gamesetinput = cl_syncinput = true;
if (PLAYER_MOVING(pp) == 0) if (PLAYER_MOVING(pp) == 0)
RESET(pp->Flags, PF_PLAYER_MOVED); RESET(pp->Flags, PF_PLAYER_MOVED);
else 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); RESET(pp->Flags2, PF2_INPUT_CAN_AIM|PF2_INPUT_CAN_TURN_GENERAL|PF2_INPUT_CAN_TURN_VEHICLE|PF2_INPUT_CAN_TURN_TURRET);
resetinputhelpers(pp); resetinputhelpers(pp);
// disable synchronised input if set by game.
if (gamesetinput)
{
gamesetinput = cl_syncinput = false;
}
if (pp->DoPlayerAction) pp->DoPlayerAction(pp); if (pp->DoPlayerAction) pp->DoPlayerAction(pp);
UpdatePlayerSprite(pp); UpdatePlayerSprite(pp);