Reset timer after closing menu

This commit is contained in:
nukeykt 2019-11-14 03:26:29 +09:00 committed by Christoph Oelckers
parent 5a19f5cd4d
commit 1dbc06bfa0
3 changed files with 10 additions and 6 deletions

View File

@ -1210,11 +1210,11 @@ void bail2dos(const char *fmt, ...)
void faketimerhandler()
{
if (((int)totalclock < ototalclock + 1) || bInMove)
if ((totalclock < ototalclock + 1) || bInMove)
return;
ototalclock++;
ototalclock = ototalclock + 1;
if (!(ototalclock&3) && moveframes < 4)
if (!((int)ototalclock&3) && moveframes < 4)
moveframes++;
PlayerInterruptKeys();
@ -2946,6 +2946,7 @@ LOOP3:
CONTROL_ClearButton(gamefunc_Escape);
// MENU2:
CONTROL_BindsEnabled = 0;
bInMove = kTrue;
nMenu = menu_Menu(1);
switch (nMenu)
@ -2970,6 +2971,9 @@ LOOP3:
}
break;
}
totalclock = ototalclock = tclocks;
bInMove = kFalse;
CONTROL_BindsEnabled = 1;
RefreshStatus();
}

View File

@ -32,7 +32,7 @@ enum
kTagRamses = 61,
};
int ototalclock = 0;
ClockTicks ototalclock = 0;
int initx, inity, initz;
short inita, initsect;
@ -418,7 +418,7 @@ void ResetEngine()
resettiming();
totalclock = 0;
ototalclock = (int)totalclock;
ototalclock = totalclock;
localclock = (int)totalclock;
numframes = 0;

View File

@ -11,7 +11,7 @@ enum {
kSectLava = 0x4000,
};
extern int ototalclock;
extern ClockTicks ototalclock;
extern int initx;
extern int inity;