- Duke: Fix potential null actor access in gi->CanSave().

This commit is contained in:
Mitchell Richters 2023-04-02 19:18:10 +10:00
parent 7217ce6ff9
commit 9dfb805b38

View file

@ -90,9 +90,9 @@ void GameInterface::MenuSound(EMenuSounds snd)
bool GameInterface::CanSave() bool GameInterface::CanSave()
{ {
if (ud.recstat == 2 || gamestate != GS_LEVEL) return false; if (ud.recstat == 2) return false;
auto &myplayer = ps[myconnectindex]; auto pActor = ps[myconnectindex].GetActor();
return (myplayer.GetActor()->spr.extra > 0); return (pActor && pActor->spr.extra > 0);
} }
bool GameInterface::StartGame(FNewGameStartup& gs) bool GameInterface::StartGame(FNewGameStartup& gs)