summaryrefslogtreecommitdiff
path: root/src/beingmanager.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 17:45:36 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 17:45:45 +0100
commit1dcaa196fd8339dbdd28f9c09c62636b663a3846 (patch)
treec7faf82210e428787804204e3dc8e5dc6c725947 /src/beingmanager.cpp
parent17b2b19e7b907ae955e500d44dd167d2f31ce7bd (diff)
downloadmana-1dcaa196fd8339dbdd28f9c09c62636b663a3846.tar.gz
mana-1dcaa196fd8339dbdd28f9c09c62636b663a3846.tar.bz2
mana-1dcaa196fd8339dbdd28f9c09c62636b663a3846.tar.xz
mana-1dcaa196fd8339dbdd28f9c09c62636b663a3846.zip
Fixed some positioning issues
Started with not being able to click NPCs properly, and I ended up correcting the draw positions of overhead text, targets and sprite ordering. It's now a bit more straight-forward. The position of a being is simply in the middle of the sprite at the bottom. When drawing the sprite, an offset remains because all the sprites are compensating for getting drawn half a tile to the left and one tile up.
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r--src/beingmanager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index af968bdb..d72c4ee4 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -188,7 +188,7 @@ Being *BeingManager::findBeingByPixel(int x, int y)
return NULL;
}
-Being *BeingManager::findBeingByName(std::string name, Being::Type type)
+Being *BeingManager::findBeingByName(const std::string &name, Being::Type type)
{
for (BeingIterator i = mBeings.begin(); i != mBeings.end(); i++)
{
@@ -321,11 +321,12 @@ Being *BeingManager::findNearestLivingBeing(Being *aroundBeing, int maxdist,
return (maxdist >= dist) ? closestBeing : NULL;
}
-bool BeingManager::hasBeing(Being *being)
+bool BeingManager::hasBeing(Being *being) const
{
- for (BeingIterator i = mBeings.begin(); i != mBeings.end(); i++)
+ for (Beings::const_iterator i = mBeings.begin(); i != mBeings.end(); i++)
{
- if (being == *i) return true;
+ if (being == *i)
+ return true;
}
return false;