diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-29 18:29:28 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-29 19:00:40 +0100 |
commit | 142509155d84c040fda2d18e5d848240c17bfd72 (patch) | |
tree | e36045a3c8977a0a2c5b8b107f5bc51befbe1a56 /crawl-ref | |
parent | f8aaba03eab180bff3171265055b3f9409beac9c (diff) | |
download | crawl-ref-142509155d84c040fda2d18e5d848240c17bfd72.tar.gz crawl-ref-142509155d84c040fda2d18e5d848240c17bfd72.zip |
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.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/fight.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 8 |
3 files changed, 5 insertions, 7 deletions
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; |