From e6507887d33d39748c3b8c0ef3b9763e7937ebc5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 23 Oct 2020 19:10:40 +0200 Subject: [PATCH] - handle_st20. --- source/games/duke/src/sectors.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index e2991377c..75441e5f0 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -703,21 +703,22 @@ static void handle_st29(int sn, DDukeActor* actor) static void handle_st20(int sn, DDukeActor* actor) { sectortype* sptr = §or[sn]; - int i,j; + int j; REDODOOR: if (sptr->lotag & 0x8000) { - SectIterator it(sn); - while ((i = it.NextIndex()) >= 0) + DDukeActor* a2; + DukeSectIterator it(sn); + while ((a2 = it.Next())) { - if (sprite[i].statnum == 3 && sprite[i].lotag == 9) + if (a2->s.statnum == 3 && a2->s.lotag == 9) { - j = sprite[i].z; + j = a2->s.z; break; } } - if (i == -1) + if (a2 == nullptr) j = sptr->floorz; } else