diff options
author | blackcustard <peterwicksstringfield@gmail.com> | 2013-08-19 21:53:48 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-12-04 18:54:18 -0500 |
commit | d1885e8d78fc129c20050fabc484bdf724b04148 (patch) | |
tree | e35757e724efe684591af89555372fa99a83542f /crawl-ref/source/mon-transit.cc | |
parent | f0ae6098ef3016ddda80d4e1020a03e67e19e39a (diff) | |
download | crawl-ref-d1885e8d78fc129c20050fabc484bdf724b04148.tar.gz crawl-ref-d1885e8d78fc129c20050fabc484bdf724b04148.zip |
Assert when trying to transit dead monsters (#7146)
Also, give a warning and ignore unmarshalled dead monsters on transit
lists.
[Committer's note: Changes from blackcustard's patch:
* Remove the testing hack in Cure Poison.
* Change the warning message in _abyss_wipe_square_at into an ASSERT,
since we have fixed the known bugs that could leave dead starcursed
masses in the grid.
* Use MSGCH_ERROR rather than the in-character MSGCH_WARN for the
warning message in unmarshall_follower_list.
* Make a minor formatting tweak in unmarshall_follower_list.
* Rewrite the commit message. -neil]
Diffstat (limited to 'crawl-ref/source/mon-transit.cc')
-rw-r--r-- | crawl-ref/source/mon-transit.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-transit.cc b/crawl-ref/source/mon-transit.cc index 0555bedc70..ab8aa44109 100644 --- a/crawl-ref/source/mon-transit.cc +++ b/crawl-ref/source/mon-transit.cc @@ -114,6 +114,8 @@ m_transit_list *get_transit_list(const level_id &lid) void add_monster_to_transit(const level_id &lid, const monster& m) { + ASSERT(m.alive()); + m_transit_list &mlist = the_lost_ones[lid]; mlist.push_back(follower(m)); @@ -289,6 +291,7 @@ int count_daction_in_transit(daction_type act) follower::follower(const monster& m) : mons(m), items() { + ASSERT(m.alive()); load_mons_items(); } @@ -303,6 +306,8 @@ void follower::load_mons_items() bool follower::place(bool near_player) { + ASSERT(mons.alive()); + monster *m = get_free_monster(); if (!m) return false; |