summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index f8ef116c..25067fca 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -21,15 +21,13 @@
#include "commandhandler.h"
-#include "beingmanager.h"
+#include "actorspritemanager.h"
#include "channelmanager.h"
#include "channel.h"
#include "game.h"
#include "localplayer.h"
#include "playerrelations.h"
-#include "gui/chat.h"
-
#include "gui/widgets/channeltab.h"
#include "gui/widgets/chattab.h"
@@ -49,7 +47,8 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab)
{
std::string::size_type pos = command.find(' ');
std::string type(command, 0, pos);
- std::string args(command, pos == std::string::npos ? command.size() : pos + 1);
+ std::string args(command, pos == std::string::npos ?
+ command.size() : pos + 1);
trim(args);
if (type == "help") // Do help before tabs so they can't override it
@@ -124,14 +123,14 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab)
{
handlePresent(args, tab);
}
- else if (type == "away")
- {
- handleAway(args, tab);
- }
else if (type == "showip" && Net::getNetworkType() == ServerInfo::TMWATHENA)
{
handleShowIp(args, tab);
}
+ else if (type == "away")
+ {
+ handleAway(args, tab);
+ }
else
{
tab->chatLog(_("Unknown command."));
@@ -340,8 +339,8 @@ void CommandHandler::handleWhere(const std::string &args, ChatTab *tab)
{
std::ostringstream where;
where << Game::instance()->getCurrentMapName() << ", coordinates: "
- << ((player_node->getPixelX() - 16) / 32) << ", "
- << ((player_node->getPixelY() - 32) / 32);
+ << player_node->getTileX() << ", "
+ << player_node->getTileY();
tab->chatLog(where.str(), BY_SERVER);
}
@@ -395,7 +394,7 @@ void CommandHandler::handleMsg(const std::string &args, ChatTab *tab)
if (tempNick.compare(playerName) == 0 || args.empty())
return;
- chatWindow->whisper(recvnick, msg, true);
+ chatWindow->whisper(recvnick, msg, BY_PLAYER);
}
else
tab->chatLog(_("Cannot send empty whispers!"), BY_SERVER);
@@ -524,7 +523,7 @@ void CommandHandler::handleShowIp(const std::string &args, ChatTab *tab)
return;
}
- beingManager->updatePlayerNames();
+ actorSpriteManager->updatePlayerNames();
}
void CommandHandler::handlePresent(const std::string &args, ChatTab *tab)