From ccafb75577f9ea8f86243d26e80fb60e56af12d1 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 9 Jun 2010 18:13:06 -0600 Subject: Merge BeingManager and FloorItemManager as ActorSpriteManager No need for two different classes to manage ActorSprites. Reviewed-by: Chuck Miller --- src/map.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index b308c775..7b62746b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -21,7 +21,7 @@ #include "map.h" -#include "beingmanager.h" +#include "actorspritemanager.h" #include "client.h" #include "configuration.h" #include "graphics.h" @@ -532,12 +532,14 @@ bool Map::getWalk(int x, int y, unsigned char walkmask) const bool Map::occupied(int x, int y) const { - const Beings &beings = beingManager->getAll(); - for (Beings::const_iterator i = beings.begin(); i != beings.end(); i++) + const ActorSprites &actors = actorSpriteManager->getAll(); + ActorSpritesConstIterator it, it_end; + for (it = actors.begin(), it_end = actors.end(); it != it_end; it++) { - const Being *being = *i; + const ActorSprite *actor = *it; - if (being->getTileX() == x && being->getTileY() == y) + if (actor->getTileX() == x && actor->getTileY() == y && + actor->getType() != ActorSprite::FLOOR_ITEM) return true; } -- cgit v1.2.3-70-g09d2