diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 14:12:20 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 14:12:20 +0000 |
commit | 21866bc51f75ebc1550a225dbe45d0bdca570b01 (patch) | |
tree | df8776459b1460edb2632e3333eaa844e8aeee0a /src/controller.cpp | |
parent | 475cebc96ee8ce31171e105382db549a364e0f0e (diff) | |
download | manaserv-21866bc51f75ebc1550a225dbe45d0bdca570b01.tar.gz manaserv-21866bc51f75ebc1550a225dbe45d0bdca570b01.tar.bz2 manaserv-21866bc51f75ebc1550a225dbe45d0bdca570b01.tar.xz manaserv-21866bc51f75ebc1550a225dbe45d0bdca570b01.zip |
Simplified server algorithm for moving objects; it now matches the one in the client.
Diffstat (limited to 'src/controller.cpp')
-rw-r--r-- | src/controller.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/controller.cpp b/src/controller.cpp index a73b7a5f..b6900c48 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -56,12 +56,12 @@ void Controller::update() { if (mBeing.get()) { - unsigned int randomX = rand() % 320 + 720; - unsigned int randomY = rand() % 320 + 840; + Point randomPos = { rand() % 320 + 720, + rand() % 320 + 840 }; - LOG_INFO("Setting new random destination " << randomX << "," - << randomY << " for being " << mBeing->getPublicID(), 2); - mBeing->setDestination(randomX, randomY); + LOG_INFO("Setting new random destination " << randomPos.x << "," + << randomPos.y << " for being " << mBeing->getPublicID(), 2); + mBeing->setDestination(randomPos); } mCountDown = 10 + rand() % 10; |