From a508dfff31cfa4c5934565bf341ad13fb7242023 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 3 Oct 2023 21:44:26 +1100 Subject: [PATCH] - Duke: Clean up player/actor accesses in `checkcursectnums()`. --- source/games/duke/src/inlines.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index 095f111e4..5fe19a943 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -78,13 +78,13 @@ inline bool isablockdoor(FTextureID dapic) return tileflags(dapic) & TFLAG_BLOCKDOOR; } - - inline int checkcursectnums(sectortype* se) { - int i; - for(i=connecthead;i>=0;i=connectpoint2[i]) - if(getPlayer(i)->GetActor() && getPlayer(i)->GetActor()->sector() == se ) return i; + for (int i = connecthead; i >= 0; i = connectpoint2[i]) + { + const auto pact = getPlayer(i)->GetActor(); + if (pact && pact->sector() == se) return i; + } return -1; }