- Delete all players upon engine shutdown.

This commit is contained in:
Mitchell Richters 2023-10-02 17:00:50 +11:00
parent 23d4cbc3bd
commit 7953fe7425
2 changed files with 7 additions and 2 deletions

View file

@ -10,6 +10,7 @@ struct CorePlayer
PlayerAngles Angles;
DCoreActor* actor;
virtual ~CorePlayer() { if (actor) actor->Destroy(); };
virtual DCoreActor* GetActor() = 0;
};

View file

@ -84,7 +84,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "hw_material.h"
#include "tiletexture.h"
#include "tilesetbuilder.h"
#include "gameinput.h"
#include "coreplayer.h"
#include "buildtiles.h"
@ -632,7 +632,11 @@ int GameMain()
r = -1;
}
//DeleteScreenJob();
if (gi) gi->FreeLevelData();
if (gi)
{
gi->FreeLevelData();
for (int i = 0; i < MAXPLAYERS; i++) delete PlayerArray[i];
}
DestroyAltHUD();
DeinitMenus();
if (StatusBar) StatusBar->Destroy();