fix #K3633 - vault guard parked at <0,0> brought \

back into play with bad data

I don't have a test case to verify the fix, and I'm not absolutely
certain that the cause has been correctly diagnosed, but I think the
problem was caused by a guard being sent into limbo because the map
was too full to place it, then while it was on the migrating monsters
list waiting for a chance to come back the fuzzer executed #wizmakemap.
If the hero left the level and subsequently returned, the guard would
arrive back but monst->mextra->egd contained data for the previous
incarnation of the level that's invalid for wizmakemap's replacement.

Treat any shopkeeper, temple priest, or vault guard who is not on his
'home' level like the Wizard has been treated since 3.6.0.  When
leaving the level they're on, put them on the migrating monsters list
scheduled to return to present position instead of stashing them in
the level's data file.  That way they can be accessed from any dungeon
level, so wizmakemap can pull ones for the level it's replacing off
the migrating monsters list when removing the old level's monsters,
handling both migration-pending and already-arrived-on-another-level.

Bonus fix:  put monsters who are on the migrating_mons list solely in
order to be accessible from other levels back first when returning to
the level they're on so that pets and the hero can't hijack their spot
when those arrive.  The Wizard has been vulnerable to that.

Not fixed:  #wizfliplevel command needs to flip parts of shk->mextra->
eshk and priest->mextra->epri for shk or priest on migrating_mons.
Vault guards don't contain anything flippable when migrating, but do
have coordinates that need fixing up while they're maintaining a
temporary corridor to/from the vault.
This commit is contained in:
PatR
2022-07-13 15:19:51 -07:00
parent a1ca981907
commit aba500b482
5 changed files with 151 additions and 51 deletions

View File

@@ -953,6 +953,10 @@ praying on an altar with pet corpse on it can revive the pet
applying a cursed oil lamp can make your hands slippery
valkyries start with a spear instead of a long sword
grid bugs don't have hands
if #wizmakemap was used to generate a replacement level while any shopkeeper,
temple priest, or vault guard from the level was off of it at the
time, the monster's eshk, epri, or egd data became invalid and would
cause trouble if the monster returned to its 'home' level
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository