- Tidy up autosaving for all the games.

* There's not really any reason to need the game's world to tic once, it's already fully loaded during the `gi->NewGame()`/`gi->NextLevel()` calls.
This commit is contained in:
Mitchell Richters 2023-04-02 19:50:41 +10:00
parent 0052ae4172
commit 10445635cf
6 changed files with 3 additions and 14 deletions

View file

@ -146,11 +146,9 @@ void G_BuildTiccmd(ticcmd_t* cmd)
//
//
//==========================================================================
bool newGameStarted;
void NewGame(MapRecord* map, int skill, bool ns = false)
{
newGameStarted = true;
ShowIntermission(nullptr, map, nullptr, [=](bool) {
gi->NewGame(map, skill, ns);
gameaction = ga_level;
@ -205,6 +203,7 @@ static void GameTicker()
gameaction = ga_level;
gi->NextLevel(g_nextmap, g_nextskill);
ResetStatusBar();
M_Autosave();
break;
case ga_newgame:
@ -259,11 +258,6 @@ static void GameTicker()
G_DoLoadGame();
break;
case ga_autosave:
if (gamestate == GS_LEVEL && !newGameStarted) M_Autosave();
newGameStarted = false;
break;
case ga_level:
Net_ClearFifo();
inputState.ClearAllInput();

View file

@ -467,7 +467,6 @@ void GameInterface::Ticker()
gFrameCount++;
PlayClock += kTicsPerFrame;
if (PlayClock == 8) gameaction = ga_autosave; // let the game run for 1 frame before saving.
for (int i = 0; i < 8; i++)
{

View file

@ -105,7 +105,6 @@ void GameInterface::Ticker()
r_NoInterpolate = false;
PlayClock+= 4; // This must be at the end of this block so that the first tic receives a value of 0!
if (PlayClock == 8) gameaction = ga_autosave; // let the game run for 1 frame before saving.
}
else r_NoInterpolate = true;

View file

@ -364,7 +364,6 @@ void GameInterface::Ticker()
GameMove();
PlayClock += 4;
if (PlayClock == 8) gameaction = ga_autosave; // let the game run for 1 frame before saving.
r_NoInterpolate = false;
}
else
@ -546,7 +545,7 @@ void EraseScreen(int nVal)
bool GameInterface::CanSave()
{
return gamestate == GS_LEVEL && !bRecord && !bPlayback && !bInDemo && nTotalPlayers == 1 && nFreeze == 0;
return !bRecord && !bPlayback && !bInDemo && nTotalPlayers == 1 && nFreeze == 0;
}
::GameStats GameInterface::getStats()

View file

@ -86,7 +86,7 @@ void GameInterface::MenuSound(EMenuSounds snd)
bool GameInterface::CanSave()
{
return (gamestate == GS_LEVEL && !CommEnabled && numplayers ==1 && /*!DemoMode &&*/ !(Player[myconnectindex].Flags & PF_DEAD));
return (!CommEnabled && numplayers ==1 && /*!DemoMode &&*/ !(Player[myconnectindex].Flags & PF_DEAD));
}
//---------------------------------------------------------------------------

View file

@ -6934,8 +6934,6 @@ void domovethings(void)
return;
}
if (PlayClock == synctics) gameaction = ga_autosave; // let the game run for 1 frame before saving.
thinktime.Reset();
thinktime.Clock();