diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-08-16 17:47:51 +0200 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-08-16 17:47:51 +0200 |
commit | e0ba8f7f67ddd08c54f0d453a316b3620d52529d (patch) | |
tree | 7324fa33f2c6af04067b77e0ce7f73d9effed1c6 /src/net/tmwserv/beinghandler.cpp | |
parent | 346d68307553c18777df4c49f9b3fe57955c5c0d (diff) | |
parent | 6460413ee2f50be561fd0824e3eaa9c2c09415b1 (diff) | |
download | mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.tar.gz mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.tar.bz2 mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.tar.xz mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.zip |
Merged changes from last month with a commit I forgot to commit before I went on vacation.
Diffstat (limited to 'src/net/tmwserv/beinghandler.cpp')
-rw-r--r-- | src/net/tmwserv/beinghandler.cpp | 64 |
1 files changed, 15 insertions, 49 deletions
diff --git a/src/net/tmwserv/beinghandler.cpp b/src/net/tmwserv/beinghandler.cpp index 7076ff8e..acd6b62c 100644 --- a/src/net/tmwserv/beinghandler.cpp +++ b/src/net/tmwserv/beinghandler.cpp @@ -187,28 +187,14 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) Being *being = beingManager->findBeing(id); int sx = 0; int sy = 0; - int dx = 0; - int dy = 0; int speed = 0; if (flags & MOVING_POSITION) { - Uint16 sx2, sy2; - msg.readCoordinates(sx2, sy2); - sx = sx2 * 32 + 16; - sy = sy2 * 32 + 16; + sx = msg.readInt16(); + sy = msg.readInt16(); speed = msg.readInt8(); } - if (flags & MOVING_DESTINATION) - { - dx = msg.readInt16(); - dy = msg.readInt16(); - if (!(flags & MOVING_POSITION)) - { - sx = dx; - sy = dy; - } - } if (!being || !(flags & (MOVING_POSITION | MOVING_DESTINATION))) { continue; @@ -228,33 +214,9 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) if (being == player_node) continue; - // If being is a player, and he only moves a little, its ok to be a little out of sync - if (being->getType() == Being::PLAYER && abs(being->getPixelX() - dx) + - abs(being->getPixelY() - dy) < 16 && - (dx != being->getDestination().x && - dy != being->getDestination().y)) - { - being->setDestination(being->getPixelX(),being->getPixelY()); - continue; - } - if (abs(being->getPixelX() - sx) + - abs(being->getPixelY() - sy) > 10 * 32) - { - // Too large a desynchronization. - being->setPosition(sx, sy); - being->setDestination(dx, dy); - } - else if (!(flags & MOVING_POSITION)) - { - being->setDestination(dx, dy); - } - else if (!(flags & MOVING_DESTINATION)) - { - being->adjustCourse(sx, sy); - } - else + if (flags & MOVING_POSITION) { - being->setDestination(sx, sy, dx, dy); + being->setDestination(sx, sy); } } } @@ -306,23 +268,27 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg) static char const *const deadMsg[] = { _("You are dead."), - _("We regret to inform you that your character was killed in battle."), + _("We regret to inform you that your character was killed in " + "battle."), _("You are not that alive anymore."), _("The cold hands of the grim reaper are grabbing for your soul."), _("Game Over!"), - _("No, kids. Your character did not really die. It... err... went to a better place."), - _("Your plan of breaking your enemies weapon by bashing it with your throat failed."), + _("No, kids. Your character did not really die. It... err... " + "went to a better place."), + _("Your plan of breaking your enemies weapon by bashing it with " + "your throat failed."), _("I guess this did not run too well."), _("Do you want your possessions identified?"), // Nethack reference _("Sadly, no trace of you was ever found..."), // Secret of Mana reference _("Annihilated."), // Final Fantasy VI reference - _("Looks like you got your head handed to you."), //Earthbound reference - _("You screwed up again, dump your body down the tubes and get you another one.") // Leisure Suit Larry 1 Reference + _("Looks like you got your head handed to you."), // Earthbound reference + _("You screwed up again, dump your body down the tubes and get " + "you another one.") // Leisure Suit Larry 1 Reference }; std::string message(deadMsg[rand()%13]); - message.append(_(" Press OK to respawn")); - OkDialog *dlg = new OkDialog(_("You died"), message); + message.append(std::string(" ") + _("Press OK to respawn.")); + OkDialog *dlg = new OkDialog(_("You Died"), message); dlg->addActionListener(&(Net::GameServer::Player::respawnListener)); } } |