diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-01 10:33:01 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-01 10:33:01 +0000 |
commit | 22ade5c3789e9b82a8ec133cb2d00db6816fe029 (patch) | |
tree | ff77854a5dc534bca6626ce1806c2f905d30d1a8 /crawl-ref/source/fight.cc | |
parent | 0179b500e318584289c2719994e2e744864cb9cb (diff) | |
download | crawl-ref-22ade5c3789e9b82a8ec133cb2d00db6816fe029.tar.gz crawl-ref-22ade5c3789e9b82a8ec133cb2d00db6816fe029.zip |
Prevent confused monsters from drifting towards the center of the
level. Fixes [2472560].
Code cleanups in _handle_monster_move().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8870 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 01d0998523..dde811e58e 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -4966,12 +4966,10 @@ static void mons_lose_attack_energy(monsters *attacker, int wpn_speed, } // A monster attacking the player. -bool monster_attack(int monster_attacking, bool allow_unarmed) +bool monster_attack(monsters* attacker, bool allow_unarmed) { ASSERT(!crawl_state.arena); - monsters *attacker = &menv[monster_attacking]; - // Friendly and good neutral monsters won't attack unless confused. if (mons_wont_attack(attacker) && !mons_is_confused(attacker)) return (false); @@ -4986,12 +4984,9 @@ bool monster_attack(int monster_attacking, bool allow_unarmed) } // Two monsters fighting each other. -bool monsters_fight(int monster_attacking, int monster_attacked, +bool monsters_fight(monsters* attacker, monsters* defender, bool allow_unarmed) { - monsters *attacker = &menv[monster_attacking]; - monsters *defender = &menv[monster_attacked]; - melee_attack attk(attacker, defender, allow_unarmed); return attk.attack(); } |