- SW: clear all pointer variables the player may still hold when terminating a level.

This commit is contained in:
Christoph Oelckers 2021-12-15 19:27:59 +01:00
parent 34bee8116c
commit 46d7487a3b
2 changed files with 8 additions and 1 deletions

View file

@ -79,7 +79,6 @@ void StatusMessage(int messageTime, const char *fmt, ...);
void DoSpiritHead();
void GameTicker();
void InitLevel(MapRecord*);
void InitNewGame();

View file

@ -545,8 +545,16 @@ void TerminateLevel(void)
// Free panel sprites for players
pClearSpriteList(pp);
// clear *all* pointers in Player!
pp->remote = {};
pp->sop = pp->sop_remote = nullptr;
pp->LadderSector = nullptr;
pp->cookieTime = 0;
pp->hi_sectp = pp->lo_sectp = nullptr;
pp->cursector = pp->lastcursector = pp->lv_sector = nullptr;
pp->sop_control = pp->sop_riding = nullptr;
pp->PanelSpriteList = {};
memset(pp->cookieQuote, 0, sizeof(pp->cookieQuote));
pp->DoPlayerAction = nullptr;