Fixed freeze with A_ClearOverlays.

This commit is contained in:
MajorCooke 2016-06-23 10:28:05 -05:00 committed by Christoph Oelckers
parent 6cf96372ba
commit 41d20fa6cf

View file

@ -1169,8 +1169,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ClearOverlays)
int count = 0;
DPSprite *pspr = player->psprites;
int startID = (pspr != nullptr) ? pspr->GetID() : start;
bool first = true;
while (pspr != nullptr)
{
if (pspr->GetID() == startID)
{
if (first)
first = false;
else
break;
}
int id = pspr->GetID();
//Do not wipe out layer 0. Ever.