summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/mon-util.cc6
-rw-r--r--crawl-ref/source/monplace.cc5
-rw-r--r--crawl-ref/source/monstuff.cc15
3 files changed, 17 insertions, 9 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 3e8055bbbd..115f1b88e8 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -8284,9 +8284,9 @@ mon_enchant mon_enchant::operator + (const mon_enchant &other) const
killer_type mon_enchant::killer() const
{
- return (who == KC_YOU? KILL_YOU :
- who == KC_FRIENDLY? KILL_MON :
- KILL_MISC);
+ return (who == KC_YOU ? KILL_YOU :
+ who == KC_FRIENDLY ? KILL_MON
+ : KILL_MISC);
}
int mon_enchant::kill_agent() const
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 3168a28796..aa5df5c286 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -2443,12 +2443,15 @@ int create_monster(mgen_data mg, bool fail_msg)
|| !mons_class_can_pass(montype, grd(mg.pos)))
{
mg.pos = find_newmons_square(montype, mg.pos);
+
// Gods other than Xom will try to avoid placing their monsters
// directly in harm's way.
if (mg.god != GOD_NO_GOD && mg.god != GOD_XOM)
{
monsters dummy;
- dummy.type = mg.cls;
+ // If the type isn't known yet assume no resists or anything.
+ dummy.type = (mg.cls == RANDOM_MONSTER) ? MONS_HUMAN
+ : mg.cls;
dummy.base_monster = mg.base_type;
dummy.god = mg.god;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 60df56cedc..05305c5b0c 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1443,11 +1443,16 @@ 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;
+ monsters *killer_mon;
+ if (!anon)
+ {
+ 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);