diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-23 16:29:49 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-23 16:29:49 +0000 |
commit | 2003fd3534a312128c620e7e36902ac07045516e (patch) | |
tree | a98804c83f3d568756344943fbd580531195429b /src/being.cpp | |
parent | b81f47c9b5fa2709af4d6e6e0669c604f3f273b1 (diff) | |
download | mana-client-2003fd3534a312128c620e7e36902ac07045516e.tar.gz mana-client-2003fd3534a312128c620e7e36902ac07045516e.tar.bz2 mana-client-2003fd3534a312128c620e7e36902ac07045516e.tar.xz mana-client-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.cpp | 14 |
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); |