diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-15 14:29:27 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-15 14:29:27 +0000 |
commit | c4fe8d851bbeceb9c768dc72f53378360f5938f2 (patch) | |
tree | 9986742b5cbfdefcc806ce8f88bb6816578b941c /crawl-ref/source/fight.cc | |
parent | 94ecb28d87ead9a3d77f2bbecc59eb8cc978d95c (diff) | |
download | crawl-ref-c4fe8d851bbeceb9c768dc72f53378360f5938f2.tar.gz crawl-ref-c4fe8d851bbeceb9c768dc72f53378360f5938f2.zip |
Fix 1994279: Crash when checking ?v (version information).
Fix 1994352: Buggy message after an invisible monster blocks an attack.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5847 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 1c92ab90c1..737b54ee9e 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -349,7 +349,7 @@ melee_attack::melee_attack(actor *attk, actor *defn, weapon(NULL), damage_brand(SPWPN_NORMAL), wpn_skill(SK_UNARMED_COMBAT), hands(HANDS_ONE), spwld(SPWLD_NONE), hand_half_bonus(false), - art_props(0), attack_verb(), verb_degree(), + art_props(0), attack_verb("bug"), verb_degree(), no_damage_message(), special_damage_message(), unarmed_attack(), shield(NULL), defender_shield(NULL), heavy_armour_penalty(0), can_do_unarmed(false), @@ -807,7 +807,7 @@ bool melee_attack::player_attack() bleed_onto_floor(where.x, where.y, defender->id(), blood, true); } - if (damage_done > 0 || !defender_visible) + if (damage_done > 0 || !defender_visible && !shield_blocked) player_announce_hit(); else if (!shield_blocked && damage_done <= 0) { @@ -3827,7 +3827,7 @@ void melee_attack::mons_perform_attack_rounds() { if (attack_shield_blocked(true)) { - shield_blocked = true; + shield_blocked = true; perceived_attack = true; this_round_hit = did_hit = true; } @@ -3864,6 +3864,10 @@ void melee_attack::mons_perform_attack_rounds() if (damage_done > 0) { +#ifdef DEBUG_DIAGNOSTICS + if (shield_blocked) + mpr("ERROR: Non-zero damage after shield block!"); +#endif mons_announce_hit(attk); check_defender_train_armour(); |