diff options
author | Neil Moore <neil@s-z.org> | 2012-03-22 03:05:28 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-03-22 03:25:31 -0400 |
commit | 900e01d22f554e0e9ba3ad43f7947b6ae12cbeea (patch) | |
tree | c6eaacc88758c9f34f808b162d2332a30f9fba73 /crawl-ref/source/mon-project.cc | |
parent | ac7c8031638fafe5a45580c4b01a79008db21b16 (diff) | |
download | crawl-ref-900e01d22f554e0e9ba3ad43f7947b6ae12cbeea.tar.gz crawl-ref-900e01d22f554e0e9ba3ad43f7947b6ae12cbeea.zip |
Don't call foo->is_player() on a null pointer.
Many of the instances of (foo == &you) were in contexts where foo could
be NULL. In those cases, include a test for foo being non-null.
Also, remove a few now-useless assertions; and add assertions to a few
cases that require but do not check for non-NULL pointers.
Fixes #5471.
Diffstat (limited to 'crawl-ref/source/mon-project.cc')
-rw-r--r-- | crawl-ref/source/mon-project.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc index 8861651a7e..46745f6c57 100644 --- a/crawl-ref/source/mon-project.cc +++ b/crawl-ref/source/mon-project.cc @@ -437,7 +437,7 @@ move_again: } // Yay for inconsistencies in beam-vs-player and beam-vs-monsters. - if (victim->is_player()) + if (victim && victim->is_player()) mprf("%s hits you!", mon.name(DESC_THE, true).c_str()); if (_iood_hit(mon, pos)) |