summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-06-09 18:13:06 -0600
committerJared Adams <jaxad0127@gmail.com>2010-06-10 12:28:28 -0600
commitccafb75577f9ea8f86243d26e80fb60e56af12d1 (patch)
treefd8e0566118c217f0efa3c32b90d6f8870822233 /src/map.cpp
parent35e024b85a5448cba235fa400f9412fd4e289ec0 (diff)
downloadmana-ccafb75577f9ea8f86243d26e80fb60e56af12d1.tar.gz
mana-ccafb75577f9ea8f86243d26e80fb60e56af12d1.tar.bz2
mana-ccafb75577f9ea8f86243d26e80fb60e56af12d1.tar.xz
mana-ccafb75577f9ea8f86243d26e80fb60e56af12d1.zip
Merge BeingManager and FloorItemManager as ActorSpriteManager
No need for two different classes to manage ActorSprites. Reviewed-by: Chuck Miller
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp12
1 files changed, 7 insertions, 5 deletions
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;
}