From 64cc270a8eabbd626f56a9cfc5650c36463a5992 Mon Sep 17 00:00:00 2001 From: pionere Date: Mon, 11 Sep 2023 16:12:01 +0200 Subject: [PATCH] more generic LoadGameLevel --- Source/interfac.cpp | 14 ++++++-------- Source/objects.cpp | 2 ++ enums.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/interfac.cpp b/Source/interfac.cpp index ef386e4d9dd..2307f6aa844 100644 --- a/Source/interfac.cpp +++ b/Source/interfac.cpp @@ -232,14 +232,8 @@ void LoadGameLevel(int lvldir) GetLevelMTypes(); // select monster types and load their fx InitThemes(); // select theme types IncProgress(); - InitObjectGFX(); // load object graphics - IncProgress(); HoldThemeRooms(); // protect themes with dFlags InitMonsters(); // place monsters - IncProgress(); - InitObjects(); // place objects - InitItems(); // place items - CreateThemeRooms(); // populate theme rooms } else { InitLvlStores(); // TODO: might want to reset RndSeed, since InitLvlStores is player dependent, but it does not matter at the moment @@ -248,9 +242,13 @@ void LoadGameLevel(int lvldir) IncProgress(); InitTowners(); - IncProgress(); - InitItems(); } + IncProgress(); + InitObjectGFX(); // load object graphics + IncProgress(); + InitObjects(); // place objects + InitItems(); // place items + CreateThemeRooms(); // populate theme rooms FreeSetPieces(); IncProgress(); InitMissiles(); diff --git a/Source/objects.cpp b/Source/objects.cpp index 8252e8db975..34f3dc5279c 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -435,6 +435,8 @@ static void AddDunObjs(int x1, int y1, int x2, int y2) assert((objectdata[OBJ_L5LDOOR].oLvlTypes & DTM_CRYPT) && (objectdata[OBJ_L5RDOOR].oLvlTypes & DTM_CRYPT)); #endif switch (currLvl._dType) { + case DTYPE_TOWN: + return; case DTYPE_CATHEDRAL: for (j = y1; j <= y2; j++) { for (i = x1; i <= x2; i++) { diff --git a/enums.h b/enums.h index 7de109c5e94..b0f53247181 100644 --- a/enums.h +++ b/enums.h @@ -3143,7 +3143,7 @@ typedef enum dungeon_type_mask { DTM_HELL = 1 << DTYPE_HELL, DTM_CRYPT = 1 << DTYPE_CRYPT, DTM_NEST = 1 << DTYPE_NEST, - DTM_ANY = 0xFF, + DTM_ANY = DTM_CATHEDRAL | DTM_CATACOMBS | DTM_CAVES | DTM_HELL | DTM_CRYPT | DTM_NEST, DTM_NONE = 0, } dungeon_type_mask;