Skip to content

Commit 5daf8ae

Browse files
committed
Fix a knockback-related crash
1 parent 4144331 commit 5daf8ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crawl-ref/source/actor.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,8 @@ void actor::collide(coord_def newpos, const actor *agent, int damage)
973973
actor *other = actor_at(newpos);
974974
// TODO: should the first of these check agent?
975975
const bool immune = never_harm_monster(agent, as_monster());
976-
const bool immune_other = never_harm_monster(agent, other->as_monster());
976+
const bool immune_other = other ? never_harm_monster(agent, other->as_monster())
977+
: false;
977978

978979
ASSERT(this != other);
979980
ASSERT(alive());

0 commit comments

Comments
 (0)