diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-14 15:16:20 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-14 15:18:05 -0500 |
commit | 94f5f2f5190977bdb792bb94752836f4d76016dc (patch) | |
tree | 4ecab492dd345c0675d652955786b8fcd3925b37 /crawl-ref/source/fight.h | |
parent | 94b9505063ae8907948a0e2b2ea3633499a94a77 (diff) | |
download | crawl-ref-94f5f2f5190977bdb792bb94752836f4d76016dc.tar.gz crawl-ref-94f5f2f5190977bdb792bb94752836f4d76016dc.zip |
Fix an issue with noise generation in melee combat
Noise generated by attacking in melee range is handled by
melee_attack::handle_noise. handle_noise was using defender->pos() as
the point of origin for the noise, but defender->pos() is not reliable
in some situations, if a monster is killed its position is reset to
zero. I added a coord_def parameter to handle_noise to use as the point
of origin instead of trying to use defender->pos and made all calls to
handle_monster store the defender's position prior to damage being
applied.
Aside from creating noise in the wrong area calling noisy with a
position of (0, 0) can cause an assertion failure at mon-behv.cc,
line 1609 in some situations.
Diffstat (limited to 'crawl-ref/source/fight.h')
-rw-r--r-- | crawl-ref/source/fight.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/fight.h b/crawl-ref/source/fight.h index 3dd95ddf93..3b18c6fea1 100644 --- a/crawl-ref/source/fight.h +++ b/crawl-ref/source/fight.h @@ -210,7 +210,7 @@ private: std::vector<attack_final_effect> final_effects; - void handle_noise(); + void handle_noise(const coord_def & pos); private: // Monster-attack specific stuff |