Fix alt-tabbed desync with demos

- Fixed: Stop the game timer if the window looses focus
This commit is contained in:
Edward Richardson 2014-11-11 02:18:52 +13:00
commit 16e0f79fd7
4 changed files with 13 additions and 19 deletions

View file

@ -141,6 +141,7 @@ gameaction_t gameaction;
gamestate_t gamestate = GS_STARTUP;
int paused;
bool pauseext;
bool sendpause; // send a pause event next tic
bool sendsave; // send a save event next tic
bool sendturn180; // [RH] send a 180 degree turn next tic
@ -1152,13 +1153,13 @@ void G_Ticker ()
// If the user alt-tabbed away, paused gets set to -1. In this case,
// we do not want to read more demo commands until paused is no
// longer negative.
if (demoplayback && paused >= 0)
if (demoplayback)
{
G_ReadDemoTiccmd (cmd, i);
}
else
{
memcpy (cmd, newcmd, sizeof(ticcmd_t));
memcpy(cmd, newcmd, sizeof(ticcmd_t));
}
// check for turbo cheats