From 142509155d84c040fda2d18e5d848240c17bfd72 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Thu, 29 Oct 2009 18:29:28 +0100 Subject: Remove mons_friendly special casing in arena. This was preventing _mons_check_set_foe from choosing targets in the arena. Also some checks to avoid setting MHITYOU and you.pet_target to fail triggering arena asserts. --- crawl-ref/source/fight.cc | 1 + crawl-ref/source/mon-util.cc | 3 --- crawl-ref/source/monstuff.cc | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index fc5e45d55c..7548436fbb 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -4123,6 +4123,7 @@ bool melee_attack::mons_attack_mons() // set explicitly by the player during sanctuary). if (perceived_attack && attacker->alive() && mons_friendly(defender_as_monster()) + && !crawl_state.arena && !mons_wont_attack(attacker_as_monster()) && you.pet_target == MHITNOT && env.sanctuary_time <= 0) diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index c9dc094741..e132fab778 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2614,9 +2614,6 @@ mon_attitude_type monsters::temp_attitude() const bool mons_friendly(const monsters *m) { - if (crawl_state.arena) - return (false); - return (m->attitude == ATT_FRIENDLY || m->has_ench(ENCH_CHARM)); } diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index caf0c8d7bc..6688f48177 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -3150,7 +3150,7 @@ void behaviour_event(monsters *mon, mon_event_type event, int src, else setTarget = true; } - else if (mons_friendly(mon)) + else if (mons_friendly(mon) && !crawl_state.arena) mon->foe = MHITYOU; if (see_cell(mon->pos())) @@ -3169,7 +3169,7 @@ void behaviour_event(monsters *mon, mon_event_type event, int src, // Just set behaviour... foe doesn't change. if (!mons_is_cornered(mon)) { - if (mons_friendly(mon)) + if (mons_friendly(mon) && !crawl_state.arena) { mon->foe = MHITYOU; simple_monster_message(mon, " returns to your side!"); @@ -4512,7 +4512,7 @@ static void _handle_behaviour(monsters *mon) // No foe? Then wander or seek the player. if (mon->foe == MHITNOT) { - if (!proxPlayer || isNeutral || patrolling) + if (crawl_state.arena || !proxPlayer || isNeutral || patrolling) new_beh = BEH_WANDER; else { @@ -4541,7 +4541,7 @@ static void _handle_behaviour(monsters *mon) if (isFriendly) { - if (patrolling) + if (patrolling || crawl_state.arena) { new_foe = MHITNOT; new_beh = BEH_WANDER; -- cgit v1.2.3-54-g00ecf