You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 537e481
Browse filesBrowse the repository at this point in the historyBrowse files
Fix: polymorphed monsters ignored their terrain until their next move.
A monster polymorphed into a form that cannot survive its location
kept standing there until its next action: newcham() never re-checked
terrain, and minliquid() only runs at the start of each monster's own
move. A flying pit fiend polymorphed into a revenant over open air
hung in midair, and a salamander in lava polymorphed into a gnoll
witherling did not burn - for slow forms the gap lasted several turns.
newcham() now calls minliquid() on the surviving monster just before
returning, so an unsuitable new form drowns, burns, or plummets
immediately (or teleports clear, for survivors), with the usual kill
attribution. The hero's polymon() already works this way via
spoteffects(). Shape changes made inside death processing or level
restoration go through a new newcham_deferred() wrapper that defers
the check to the monster's next move, since running minliquid() there
could re-enter monster death handling. Because newcham() can now kill
the monster much more often, every caller was audited and the
unguarded ones hardened:
* mon.c:
- newcham() tail-calls minliquid() unless defer_minliquid is set;
newcham_deferred() (save/restore, safe under nesting) is used by
the mondead() vampshifter/changeling and Izchak reverts, both
vamp_stone() reverts, restore_cham(), icequeenrevive(), and
become_flayer()'s Izchak revert.
- mcalcdistress(): skip the rest of a monster's per-turn upkeep if
decide_to_shapeshift() left it dead.
- meatmetal()/meatobj()/meatcorpse(): report a death from eating
polyfodder through the existing "ptr == NULL means it died" idiom
instead of returning "ate and still alive".
- become_flayer(): bail out with MM_AGR_DIED if the new mind flayer
dies (flight does not protect in the Plane of Water's water).
- rescham(): stop processing a chameleon that died reverting.
* mhitm.c: AD_DGST digestion transforms now return
MM_DEF_DIED | MM_AGR_DIED instead of running grow_up() on a dead
eater.
* mhitu.c: passiveum() AD_SLIM returns 2 (attacker died) when turning
the attacker into a green slime kills it.
* muse.c: the wand/potion self-polymorph and polymorph-trap handlers
return 1 (died) rather than 2 (did something) when the new form
dies, so pet movement does not keep processing the dead monster and
re-pocket its dropped inventory (object chain corruption).
* trap.c: mintrap() POLY_TRAP_SET sets trapkilled if the new form
dies; poly traps can sit on puddles or sewage, which are lethal to
iron golem and long worm forms.
0 commit comments