mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- fixed a few dangling pointers on traveling between levels
https://forum.zdoom.org/viewtopic.php?t=69747
This commit is contained in:
parent
0ab2ddca4c
commit
c46dcd03a3
2 changed files with 9 additions and 1 deletions
|
@ -1428,7 +1428,6 @@ void FLevelLocals::StartTravel ()
|
|||
if (Players[i]->health > 0)
|
||||
{
|
||||
pawn->UnlinkFromWorld (nullptr);
|
||||
pawn->BlockingLine = nullptr;
|
||||
int tid = pawn->tid; // Save TID
|
||||
pawn->SetTID(0);
|
||||
pawn->tid = tid; // Restore TID (but no longer linked into the hash chain)
|
||||
|
|
|
@ -279,6 +279,15 @@ void FLevelLocals::ClearPortals()
|
|||
|
||||
void FLevelLocals::ClearLevelData()
|
||||
{
|
||||
{
|
||||
auto it = GetThinkerIterator<AActor>(NAME_None, STAT_TRAVELLING);
|
||||
for (AActor *actor = it.Next(); actor != nullptr; actor = it.Next())
|
||||
{
|
||||
actor->BlockingLine = nullptr;
|
||||
actor->BlockingFloor = actor->BlockingCeiling = actor->Blocking3DFloor = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
interpolator.ClearInterpolations(); // [RH] Nothing to interpolate on a fresh level.
|
||||
Thinkers.DestroyAllThinkers();
|
||||
ClearAllSubsectorLinks(); // can't be done as part of the polyobj deletion process.
|
||||
|
|
Loading…
Reference in a new issue