From 7b60bfdb95efd545718b3c01bf61f3e39bc37b98 Mon Sep 17 00:00:00 2001 From: sirlemonhead Date: Fri, 29 Nov 2019 21:24:11 +0000 Subject: [PATCH] Fix infinite loop in DimLights(). Should fix game locking up when finishing the final level. --- source/exhumed/src/object.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/exhumed/src/object.cpp b/source/exhumed/src/object.cpp index 0c2f0f45f..4a085abad 100644 --- a/source/exhumed/src/object.cpp +++ b/source/exhumed/src/object.cpp @@ -1490,9 +1490,10 @@ void DimLights() if (sector[i].floorshade < 100) sector[i].floorshade++; - int nWall = sector[i].wallptr; + short startwall = sector[i].wallptr; + short endwall = startwall + sector[i].wallnum; - while (nWall < nWall + sector[i].wallnum) + for (int nWall = startwall; nWall < endwall; nWall++) { if (wall[nWall].shade < 100) wall[nWall].shade++;