diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-18 22:16:44 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-18 22:16:44 +0000 |
commit | d05d98b63eed3a41480b235c4c61669059016e7b (patch) | |
tree | dd68f45078d2bbabc0a0d156d176627b76ee0871 /crawl-ref/source/monstuff.cc | |
parent | d120c8b8553ad8e36a20a63cfe597b2f1eafceef (diff) | |
download | crawl-ref-d05d98b63eed3a41480b235c4c61669059016e7b.tar.gz crawl-ref-d05d98b63eed3a41480b235c4c61669059016e7b.zip |
Fix crashes when spore explosions kill the attacking monster.
And we're at our 10.000 commit! o_O
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10000 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 85ef6af6b2..60df56cedc 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1239,12 +1239,12 @@ int monster_die(monsters *monster, killer_type killer, } const bool death_message = !silent && !did_death_message - && mons_near(monster) - && (player_monster_visible(monster) - || crawl_state.arena); + && mons_near(monster) + && (player_monster_visible(monster) + || crawl_state.arena); const bool created_friendly = testbits(monster->flags, MF_CREATED_FRIENDLY); - const bool anon = (killer_index == ANON_FRIENDLY_MONSTER); + bool anon = (killer_index == ANON_FRIENDLY_MONSTER); const mon_holy_type targ_holy = mons_holiness(monster); switch (killer) @@ -1444,6 +1444,11 @@ int monster_die(monsters *monster, killer_type killer, bool notice = false; monsters *killer_mon = &menv[killer_index]; + // If the killer is already dead treat it like an anonymous + // monster. + if (killer_mon->type == -1) + anon = true; + const mon_holy_type killer_holy = anon ? MH_NATURAL : mons_holiness(killer_mon); |