- 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 stopinterpolation(int* posptr);
void dointerpolations(int smoothratio); void dointerpolations(int smoothratio);
int* animateptr(int i); int* animateptr(int i);
void resetGameClock();
void backuppos(player_struct* p, bool noclipping = false); void backuppos(player_struct* p, bool noclipping = false);
void backuplook(player_struct* p); void backuplook(player_struct* p);

View file

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

View file

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

View file

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

View file

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

View file

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