summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-23 16:29:49 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-23 16:29:49 +0000
commit2003fd3534a312128c620e7e36902ac07045516e (patch)
treea98804c83f3d568756344943fbd580531195429b /src/being.cpp
parentb81f47c9b5fa2709af4d6e6e0669c604f3f273b1 (diff)
downloadmana-2003fd3534a312128c620e7e36902ac07045516e.tar.gz
mana-2003fd3534a312128c620e7e36902ac07045516e.tar.bz2
mana-2003fd3534a312128c620e7e36902ac07045516e.tar.xz
mana-2003fd3534a312128c620e7e36902ac07045516e.zip
Restored Being::setDestination, a pointer to the current map is now kept as a member in Being.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 069172c3..b4f1e042 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -179,6 +179,7 @@ Being::Being():
aspd(350),
m_weapon(0),
m_id(0),
+ map(0),
hairStyle(1), hairColor(1),
speech_time(0),
damage_time(0),
@@ -192,6 +193,14 @@ Being::~Being()
clearPath();
}
+void Being::setDestination(int destX, int destY)
+{
+ if (!map)
+ return;
+
+ setPath(map->findPath(x, y, destX, destY));
+}
+
void Being::clearPath()
{
path.clear();
@@ -250,6 +259,11 @@ void Being::setDamage(const std::string &text, int time)
showDamage = true;
}
+void Being::setMap(Map *map)
+{
+ this->map = map;
+}
+
void Being::setName(char *text)
{
strcpy(name, text);