- Duke: moved the clock reset to a separate function and deleted the unused lockclock variable.

This commit is contained in:
Christoph Oelckers 2020-08-30 07:53:20 +02:00
parent d49aedacea
commit cc04d41903
6 changed files with 10 additions and 18 deletions

View file

@ -243,6 +243,7 @@ void setinterpolation(int* posptr);
void stopinterpolation(int* posptr);
void dointerpolations(int smoothratio);
int* animateptr(int i);
void resetGameClock();
void backuppos(player_struct* p, bool noclipping = false);
void backuplook(player_struct* p);

View file

@ -182,7 +182,6 @@ int domovethings()
// mplpadsave();
ud.camerasprite = -1;
lockclock += TICSPERFRAME;
if (earthquaketime > 0) earthquaketime--;
if (rtsplaying > 0) rtsplaying--;
@ -360,14 +359,17 @@ void startmainmenu()
FX_StopAllSounds();
}
static void Startup()
void resetGameClock()
{
I_ResetTime();
lastTic = -1;
gameclock = 0;
lockclock = 0;
cloudclock = 0;
}
static void Startup()
{
resetGameClock();
ps[myconnectindex].ftq = 0;
if (userConfig.CommandMap.IsNotEmpty())

View file

@ -114,8 +114,6 @@ int16_t cyclers[MAXCYCLERS][6];
int16_t mirrorsector[64];
int16_t mirrorwall[64];
int lockclock;
// Redneck Rampage
int wupass;
int chickenplant;

View file

@ -106,8 +106,6 @@ extern int16_t cyclers[MAXCYCLERS][6];
extern int16_t mirrorsector[64];
extern int16_t mirrorwall[64];
extern int lockclock;
extern int wupass;
extern int chickenplant;
extern int thunderon;

View file

@ -756,12 +756,8 @@ void prelevel_common(int g)
void resettimevars(void)
{
I_ResetTime();
lastTic = -1;
gameclock = 0;
cloudclock = 0;
resetGameClock();
levelTextTime = 85;
lockclock = 0;
ready2send = 1;
if (camsprite >= 0)
hittype[camsprite].temp_data[0] = 0;

View file

@ -443,7 +443,6 @@ void GameInterface::SerializeGameState(FSerializer& arc)
("mirrorcnt", mirrorcnt)
.Array("mirrorsector", mirrorsector, mirrorcnt)
.Array("mirrorwall", mirrorwall, mirrorcnt)
("lockclock", lockclock)
("wupass", wupass)
("chickenplant", chickenplant)
("thunderon", thunderon)
@ -482,8 +481,6 @@ void GameInterface::SerializeGameState(FSerializer& arc)
// Todo: move to backend
("gameclock", gameclock)
("lockclock", lockclock)
.Array("po", po, ud.multimode)
.EndObject();