Skip to content

Commit

Permalink
more generic LoadGameLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Sep 12, 2023
1 parent 228acd5 commit 64cc270
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 6 additions & 8 deletions Source/interfac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions Source/objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 64cc270

Please sign in to comment.