Pet titan killed itself with a boulder

A pet titan dropped a boulder over a pool, and the code killed
the titan, because the code was considering the titan to be in
the water.

If a flyer or a floater is over the pool, don't kill them off
if a boulder is dropped in there.  Also make the pet movement
code handle the case where the pet might've died while dropping
items.
This commit is contained in:
Pasi Kallinen
2024-05-28 17:57:16 +03:00
parent 6b750cb551
commit 5fe872bf98
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -83,7 +83,8 @@ boulder_hits_pool(
will be dead here; killing it again would yield impossible will be dead here; killing it again would yield impossible
"dmonsfree: N removed doesn't match N+1 pending" when other "dmonsfree: N removed doesn't match N+1 pending" when other
monsters have finished their current turn */ monsters have finished their current turn */
if ((mtmp = m_at(rx, ry)) != 0 && !DEADMONSTER(mtmp)) if ((mtmp = m_at(rx, ry)) != 0 && !DEADMONSTER(mtmp)
&& !m_in_air(mtmp))
mondied(mtmp); mondied(mtmp);
if (ttmp) if (ttmp)
+2 -2
View File
@@ -1010,8 +1010,8 @@ dog_move(
if (edog) { if (edog) {
j = dog_invent(mtmp, edog, udist); j = dog_invent(mtmp, edog, udist);
if (j == 2) if (j == 2 || mon_offmap(mtmp))
return MMOVE_DIED; /* died */ return DEADMONSTER(mtmp) ? MMOVE_DIED : MMOVE_DONE;
else if (j == 1) else if (j == 1)
goto newdogpos; /* eating something */ goto newdogpos; /* eating something */