diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-12-11 11:08:59 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-12-11 11:08:59 +0100 |
commit | 54c2ea1ac1ceb7926f2d489e1cbcc7e9a28f990a (patch) | |
tree | 493d2b959580683b31e88af7d8a0afb34d23be00 /crawl-ref/source/fight.cc | |
parent | b87399f832fec14917a0155bacb13b026efd9c2a (diff) | |
download | crawl-ref-54c2ea1ac1ceb7926f2d489e1cbcc7e9a28f990a.tar.gz crawl-ref-54c2ea1ac1ceb7926f2d489e1cbcc7e9a28f990a.zip |
Use AT_ not AF_ for WEAP_ONLY, so statues won't use bows like a cudgel.
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 063fd8c9f8..79adf9c3dc 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -5227,8 +5227,17 @@ void melee_attack::mons_perform_attack_rounds() init_attack(); - const mon_attack_def attk = mons_attack_spec(attacker_as_monster(), + mon_attack_def attk = mons_attack_spec(attacker_as_monster(), attack_number); + if (attk.type == AT_WEAP_ONLY) + { + int weap = attacker_as_monster()->inv[MSLOT_WEAPON]; + if (weap == NON_ITEM) + attk.type = AT_NONE; + else if (is_range_weapon(mitm[weap])) + attk.type = AT_SHOOT; + } + if (attk.type == AT_NONE) { // Make sure the monster uses up some energy, even |