From 7c2ee3333fcbb7738356bf9c45a3469bddf87e57 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 03:13:00 +0200 Subject: [PATCH] Theme_MonstPit cleanup --- Source/themes.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Source/themes.cpp b/Source/themes.cpp index 044fa4c58..a90a7be02 100644 --- a/Source/themes.cpp +++ b/Source/themes.cpp @@ -582,21 +582,18 @@ void Theme_MonstPit(int t) r = random_(0, 100) + 1; ixp = 0; iyp = 0; - if (r > 0) { - while (TRUE) { - if (dTransVal[ixp][iyp] == themes[t].ttval && !nSolidTable[dPiece[ixp][iyp]]) { - --r; - } - if (r <= 0) { - break; - } - ixp++; - if (ixp == MAXDUNX) { - ixp = 0; - iyp++; - if (iyp == MAXDUNY) { - iyp = 0; - } + while (r > 0) { + if (dTransVal[ixp][iyp] == themes[t].ttval && !nSolidTable[dPiece[ixp][iyp]]) { + --r; + } + if (r <= 0) + continue; + ixp++; + if (ixp == MAXDUNX) { + ixp = 0; + iyp++; + if (iyp == MAXDUNY) { + iyp = 0; } } }