A saner way to remove Stingers, may fix Physical crash

This commit is contained in:
erorcun 2021-02-20 23:58:08 +03:00
parent 040c6f9027
commit 71cf666bbd

View File

@ -75,10 +75,16 @@ CStinger::Remove()
for (int32 i = 0; i < NUM_STINGER_SEGMENTS; i++) { for (int32 i = 0; i < NUM_STINGER_SEGMENTS; i++) {
CStingerSegment *spikeSegment = pSpikes[i]; CStingerSegment *spikeSegment = pSpikes[i];
#ifdef FIX_BUGS
CWorld::Remove(spikeSegment);
delete spikeSegment;
#else
if (spikeSegment->m_entryInfoList.first != nil) if (spikeSegment->m_entryInfoList.first != nil)
spikeSegment->bRemoveFromWorld = true; spikeSegment->bRemoveFromWorld = true;
else else
delete spikeSegment; delete spikeSegment;
#endif
} }
bIsDeployed = false; bIsDeployed = false;
} }