diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2007-03-02 23:30:17 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2007-03-02 23:30:17 +0000 |
commit | af1ce69940a9c0b46907402e7d69e6ac9ea96912 (patch) | |
tree | 016a6a8a4734f794e56093e1611530749eb7fab0 /src/controller.cpp | |
parent | 07782116ae9158c20165dd4d60bdb96017ac009f (diff) | |
download | manaserv-af1ce69940a9c0b46907402e7d69e6ac9ea96912.tar.gz manaserv-af1ce69940a9c0b46907402e7d69e6ac9ea96912.tar.bz2 manaserv-af1ce69940a9c0b46907402e7d69e6ac9ea96912.tar.xz manaserv-af1ce69940a9c0b46907402e7d69e6ac9ea96912.zip |
Implemented being death, removal of dead mobs and sitting.
Diffstat (limited to 'src/controller.cpp')
-rw-r--r-- | src/controller.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/controller.cpp b/src/controller.cpp index a243006c..42a64b66 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -31,16 +31,29 @@ void Controlled::update() */ if (mCountDown == 0) { - Point randomPos = { rand() % 320 + 720, - rand() % 320 + 840 }; - setDestination(randomPos); - mCountDown = 10 + rand() % 10; + if (mAction != DEAD) + { + Point randomPos = { rand() % 320 + 720, + rand() % 320 + 840 }; + setDestination(randomPos); + mCountDown = 10 + rand() % 10; - LOG_DEBUG("Setting new random destination " << randomPos.x << "," - << randomPos.y << " for being " << getPublicID()); + LOG_DEBUG("Setting new random destination " << randomPos.x << "," + << randomPos.y << " for being " << getPublicID()); + } + else + { + raiseUpdateFlags(UPDATEFLAG_REMOVE); + } } else { mCountDown--; } } + +void Controlled::die() +{ + mCountDown = 600; + Being::die(); +} |