[Issue Report]: Game loads endlessly
Chance4us opened this issue · 2 comments
Operating System
Linux x64
DevilutionX version
Custom build (commit baaa906)
Describe
Game can not be loaded.
To Reproduce
- Load attached game
endless.zip - Go trough blue portal
- Go through red portal
- Save the game
- Exit the game entirely
- Load the game again
- See that game can not be loaded
Expected Behavior
No endless loading
Additional context
Further events or possible causes have not yet been investigated
Problem appears to be rooted in PlaceUniqueMonst()
, where an infinite loop is entered when attempting to place Lazarus:
devilutionX/Source/monster.cpp
Line 348 in baaa906
CanPlaceMonster()
returns false
infinitely, deeming every iterated location as being Solid in IsTileOccupied()
call via IsTileSolid()
. I've confirmed that the SOLData
global array is populated prior to attempting to place unique monsters, and it's quite absurd that the game was able to successfully place Lazarus in the level prior.
LoadL1Dungeon()
calls LoadDungeonBase()
before Pass3()
.
devilutionX/Source/levels/drlg_l1.cpp
Lines 1328 to 1335 in baaa906
LoadDungeonBase()
calls SetMapMonsters()
which begins by attempting to place Lazarus in the map. PlaceUniqueMonst()
then runs that loop to find a random valid position to place him. However there are no valid positions because Pass3()
hasn't been called yet, meaning dPiece
is completely empty.