From 1f7095e226c96fcdf1e06a52a7ff86ced76b0f12 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 13 Oct 2019 19:57:05 +0300 Subject: [PATCH] Fix addressing deleted trap when helping monster out of a pit Move reward_untrap before fill_pit, as the trap may get deleted. --- doc/fixes36.3 | 1 + src/trap.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 8182bfea8..e87280bdd 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -182,6 +182,7 @@ fix firing attached iron ball when swallowed causing a sanity error fix vault guard impossible when he could not relocate in certain situation fix temple priests or shopkeepers moving over other monsters fix hero still hiding under a statue shattered by a land mine +fix helping a monster out of a pit addressing a deleted trap Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/trap.c b/src/trap.c index 994cbede0..8d0dddb6a 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4346,8 +4346,8 @@ struct trap *ttmp; You("pull %s out of the pit.", mon_nam(mtmp)); mtmp->mtrapped = 0; - fill_pit(mtmp->mx, mtmp->my); reward_untrap(ttmp, mtmp); + fill_pit(mtmp->mx, mtmp->my); return 1; }