- let SyncInput return a combination of gamesetinput and cl_syncinput - also serialize gamesetinput.

This commit is contained in:
Christoph Oelckers 2020-11-30 23:45:21 +01:00
parent ae36ea88c3
commit 5850c7b284
3 changed files with 21 additions and 19 deletions

View file

@ -228,18 +228,3 @@ extern bool sendPause;
extern int lastTic;
//---------------------------------------------------------------------------
//
// Inline functions to help with edge cases where synchronised input is needed.
//
//---------------------------------------------------------------------------
extern bool gamesetinput;
inline void setForcedSyncInput()
{
if (!cl_syncinput) gamesetinput = cl_syncinput = true;
}
inline void resetForcedSyncInput()
{
if (gamesetinput) gamesetinput = cl_syncinput = false;
}

View file

@ -105,8 +105,24 @@ void SetupGameButtons();
void ApplyGlobalInput(InputPacket& input, ControlInfo* const hidInput, bool const crouchable = true, bool const disableToggle = false);
extern ESyncBits ActionsToSend;
double InputScale();
extern bool gamesetinput;
inline bool SyncInput()
{
return cl_syncinput;
return gamesetinput || cl_syncinput;
}
//---------------------------------------------------------------------------
//
// Inline functions to help with edge cases where synchronised input is needed.
//
//---------------------------------------------------------------------------
inline void setForcedSyncInput()
{
gamesetinput = true;
}
inline void resetForcedSyncInput()
{
gamesetinput = false;
}

View file

@ -643,7 +643,8 @@ void SerializeMap(FSerializer& arc)
("parallaxyo", parallaxyoffs_override)
("parallaxys", parallaxyscale_override)
("pskybits", pskybits_override)
("numsprites", Numsprites);
("numsprites", Numsprites)
("gamesetinput", gamesetinput);
SerializeInterpolations(arc);