diasurgical / devilution

Diablo devolved - magic behind the 1996 computer game
Other
8.66k stars 921 forks source link

diablo: add BUGFIX for LoadGameLevel #2287

Closed mewmew closed 1 year ago

mewmew commented 1 year ago

An incorrect placement of unique monsters was used in set levels when entering through Town Portal from Tristram (or entering from a dungeon level with different dungeon type).

To reproduce, use a Town Portal to enter any set level containing unique monsters (e.g. Skeleton King's Lair or Archbishop Lazarus' Lair).

As LoadGameLevel invokes InitMonsters without first invoking FillSolidBlockTbls for set levels, nSolidTable will contain garbage data (the collision mapping for mini tiles of the previous dungeon type, NOT the current dungeon type).

galaxyhaxz commented 1 year ago

IMHO in general these functions should only be called the first time the level is generated. The fact is has to regenerate/respawn everything and expect the seed to put them in the right spots alone is bad design that's led to many bugs including this one.