- added a workaround for a crashing condition in FThinkerIterator.

It can actually happen that the thinker chain gets broken if an actor being iterated happens to destroy the immediately following actor in the chain as well. In that case both actors lose their chain links and the iterator cannot advance any further, the only solution to avoid a crash is to terminate the iteration of the current list.
This commit is contained in:
Christoph Oelckers 2017-01-10 00:38:08 +01:00
parent 26170419f4
commit 96788850d3

View file

@ -675,6 +675,9 @@ DThinker *FThinkerIterator::Next (bool exact)
{
return thinker;
}
// This can actually happen when a Destroy call on 'thinker' happens to destroy 'm_CurrThinker'.
// In that case there is no chance to recover, we have to terminate the iteration of this list.
if (m_CurrThinker == nullptr) break;
}
}
if ((m_SearchingFresh = !m_SearchingFresh))