From 412bcd6e779cd3883bc5c6ce29a8e79ad32c63f4 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 13 Feb 2009 00:47:33 +0000 Subject: Remove a great many cases where mgrd is accessed directly in favour of monster_at(). The hope is to eventually remove mgrd completely (in favour of scanning through the monster list, or a different datastructure which gets updated automatically when monsters move), and thus fix all the mgrd-out-of-sync bugs in one fell swoop. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9056 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abyss.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/abyss.cc') diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc index 352caeb7e2..b5eaa2ecbb 100644 --- a/crawl-ref/source/abyss.cc +++ b/crawl-ref/source/abyss.cc @@ -21,6 +21,7 @@ REVISION("$Rev$"); #include "mapmark.h" #include "message.h" #include "misc.h" +#include "mon-util.h" #include "monplace.h" #include "mtransit.h" #include "player.h" @@ -467,8 +468,8 @@ void area_shift(void) #endif lose_item_stack( *ri ); - if (mgrd(*ri) != NON_MONSTER) - _abyss_lose_monster( menv[ mgrd(*ri) ] ); + if (monsters* m = monster_at(*ri)) + _abyss_lose_monster(*m); } // Shift all monsters and items to new area. -- cgit v1.2.3-54-g00ecf