Merge branch 'polyobj-setup-fixes' into 'master'

Polyobj setup fixes

If you're wondering why ERZ2 crashes lately, yes, it's my fault once again it turns out! Ideally we shouldn't have loose spawn points or anchors without an actual PolyObject to go with them in the first place, but this fix re-adds the safety check that prevented them from crashing the game before.

If it wasn't clear already, this fix is rather important, so please get in asap.

See merge request !7
This commit is contained in:
Monster Iestyn 2015-08-14 13:48:37 -04:00
commit ee4a3fffee
1 changed files with 8 additions and 0 deletions

View File

@ -657,6 +657,14 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
// TODO: sound sequence is in args[3]
}*/
// make sure array isn't empty
// since Polyobj_findExplicit is disabled currently, we have to do things here instead now!
if (po->segCount == 0)
{
po->isBad = true;
CONS_Debug(DBG_POLYOBJ, "Polyobject %d is empty\n", po->id);
return;
}
// set the polyobject's spawn spot
po->spawnSpot.x = spawnSpot->x;