Implement the suggestion that a monster killing itself with acid to avoid turning to stone or with fire to avoid turning into green slime not break pacifist conduct even if the player caused the "turning into" situation that triggered the accidental suicide. Along the way I discovered a serious bug: zhitm() applies damage to target monster but leaves it to caller to finish killing off that monster when damage is fatal, but muse_unslime() called it without checking whether the monster should die. For fire breath that shouldn't matter since all fire breathers are immune to fire damage, but when support for wands of fire and fire horns was added later it just cloned the fire breath code and neglected to check for fatal damage. The result was that a monster with 0 HP would be left on the map, then impossible "dmonsfree: 1 removed doesn't match 0 pending" would be given when taking it off fmon list, but a stale monster symbol (presumably level.monsters[][] pointer too) was left on the map which eventually led to monsndx panic or arbitrary crash.
24 KiB
24 KiB