fix #H2384 - ceiling hiding by poly'd hero (trunk only)

From a bug report, a hero hiding on the
ceiling while poly'd into a piercer or lurker-above could be moved long
distances when a monster attacked his location, because when the attacker
moves into hero's spot, hero's new location is chosen before the attacker
had released its own spot.  If things are crowded, the nearest open space
can be quite far away, including beyond nonpassable walls.  Fix by taking
attacker off the map before choosing hero's destination, so in crowded
conditions they will likely end up trading places.

     This also prevents eels and sharks from moving onto land when the
hero has hidden on the ceiling next to their pool.  They'll miss without
moving into hero's spot, but the hero will become unhidden so they'll be
able to make ordinary water-to-shore attack on their next turn.

     Lastly, when the attacker is a long worm, the spot chosen for hero
might be filled by its tail by the time hero actually moves.  So double
check and possibly re-select target spot after moving a worm's tail.
This commit is contained in:
nethack.rankin
2011-07-17 09:19:17 +00:00
parent edaa9440b7
commit 8d5a04a1c0
2 changed files with 44 additions and 18 deletions

View File

@@ -366,6 +366,13 @@ when applicable, give "your body rises from the dead as an <undead>..."
even when bones data isn't being saved
have shk claim ownership of worn saddle dropped by dying pet if hero is
not within the same shop at the time of the drop
for poly'd hero hiding on ceiling who gets attacked, make attacker's position
be an eligible location for hero when vacating hero's spot for attacker
to prevent ending up far away under crowded conditions
for poly'd hero hiding on ceiling, attack by sea monsters won't move them
into hero's position unless it is over water or they're already on land
for poly'd hero hiding on ceiling, attack by long worm might fill hero's
destination with worm's tail, so double check and maybe choose again
Platform- and/or Interface-Specific Fixes