|
From: <gi...@cr...> - 2017-06-15 17:20:12
|
via dbfcba73ebbeb46c4d2e77d26494032e2e15a8d7 (commit)
from 828620c7301e1e00c041161cb3d8c6db8e95b6fc (commit)
-----------------------------------------------------------------------
commit dbfcba73ebbeb46c4d2e77d26494032e2e15a8d7
Author: Kyle Rawlins <ra...@gm...>
Date: Thu Jun 15 13:14:40 2017 -0400
Prevent random xom crashes on felid revival
If xom_tick got to the point of calling `xom_choose_action`, this would
crash on an old assert. This commit lets xom act immediately after
revival, which may or may not be desirable (before it was impossible,
because the game would crash instead).
I've also prevented xom from taking credit for a felid revival (I'm not
sure when this triggered before, but it would always trigger in the case
that previously crashed. This change is just cosmetic.
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/xom.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index b1f9fea..8bae633 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -2831,9 +2831,10 @@ static void _handle_accidental_death(const int orig_hp,
// Did ouch() return early because the player died from the Xom
// effect, even though neither is the player under penance nor is
// Xom bored?
- if (!you.did_escape_death()
- && you.escaped_death_aux.empty()
- && !_player_is_dead())
+ if ((!you.did_escape_death()
+ && you.escaped_death_aux.empty()
+ && !_player_is_dead())
+ || you.pending_revival) // don't let xom take credit for felid revival
{
// The player is fine.
return;
@@ -3176,7 +3177,7 @@ xom_event_type xom_choose_action(bool niceness, int sever, int tension)
{
sever = max(1, sever);
- if (_player_is_dead())
+ if (_player_is_dead() && !you.pending_revival)
{
// This should only happen if the player used wizard mode to
// escape death from deep water or lava.
--
Dungeon Crawl Stone Soup
|