From 41d20fa6cf585b83ac64c2269a0b5c55cc10a656 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Thu, 23 Jun 2016 10:28:05 -0500 Subject: [PATCH] Fixed freeze with A_ClearOverlays. --- src/p_pspr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index ebfc14da3..e63490110 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -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.