From bf2a59fd761571998062b21409ee678e2852254b Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 3 Jan 2009 21:57:12 +0000 Subject: Add missing tension check for one of Xom's friendly summoning routines. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8183 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/xom.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/xom.cc') diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 7904b6f1a0..360bf995a8 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -878,7 +878,8 @@ static bool _xom_is_good(int sever, int tension) done = true; } - else if (x_chance_in_y(7, sever)) + // It's pointless to send in help if there's no danger. + else if (tension > 0 && x_chance_in_y(7, sever)) { monster_type mon = _xom_random_demon(sever); const bool is_demonic = (mons_class_holiness(mon) == MH_DEMONIC); @@ -1634,6 +1635,7 @@ static bool _xom_is_bad(int sever, int tension) mon_inv_type slots[] = {MSLOT_WEAPON, MSLOT_ALT_WEAPON, MSLOT_MISSILE}; + for (int i = 0; i < 3; ++i) { int idx = mon->inv[slots[i]]; -- cgit v1.2.3-54-g00ecf