From a34eb2bfc8c20cf1ef7db1a218a5716b15fc1d58 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 9 Apr 2019 17:06:37 +0200 Subject: [PATCH] Clean up SkipThemeRoom --- Source/gendung.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/Source/gendung.cpp b/Source/gendung.cpp index 2e8b60e9b..7844a09e9 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -1107,26 +1107,15 @@ void DRLG_HoldThemeRooms() BOOL SkipThemeRoom(int x, int y) { - int i; // ebx - THEME_LOC *v3; // eax - int v4; // esi - - i = 0; - if (themeCount <= 0) - return 1; - v3 = themeLoc; - while (1) { - if (x >= v3->x - 2 && x <= v3->x + v3->width + 2) { - v4 = v3->y; - if (y >= v4 - 2 && y <= v4 + v3->height + 2) - break; - } - ++i; - ++v3; - if (i >= themeCount) - return 1; + int i; + + for (i = 0; i < themeCount; i++) { + if (x >= themeLoc[i].x - 2 && x <= themeLoc[i].x + themeLoc[i].width + 2 + && y >= themeLoc[i].y - 2 && y <= themeLoc[i].y + themeLoc[i].height + 2) + return 0; } - return 0; + + return 1; } void InitLevels()