diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-28 21:44:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-28 21:49:37 +0300 |
commit | a83513ef88a9cfca8692db9176b68ddeea71931f (patch) | |
tree | 1d01876eb230a36d5c5f98cddd9c57e2476150ab /src/actions | |
parent | cfc84945c9cee7d42accdad39ff387738a3d32ac (diff) | |
download | manaverse-a83513ef88a9cfca8692db9176b68ddeea71931f.tar.gz manaverse-a83513ef88a9cfca8692db9176b68ddeea71931f.tar.bz2 manaverse-a83513ef88a9cfca8692db9176b68ddeea71931f.tar.xz manaverse-a83513ef88a9cfca8692db9176b68ddeea71931f.zip |
Fix code style.
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/actions.cpp | 4 | ||||
-rw-r--r-- | src/actions/chat.cpp | 18 | ||||
-rw-r--r-- | src/actions/commands.cpp | 20 | ||||
-rw-r--r-- | src/actions/commands.h | 2 | ||||
-rw-r--r-- | src/actions/windows.cpp | 2 | ||||
-rw-r--r-- | src/actions/windows.h | 2 |
6 files changed, 25 insertions, 23 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 6305be217..cb13bb01e 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -290,7 +290,7 @@ impHandler0(dropItem) return false; } -impHandler0(heal) +impHandler(heal) { if (actorManager) { @@ -461,7 +461,7 @@ impHandler0(untarget) return false; } -impHandler0(attack) +impHandler(attack) { if (!localPlayer || !actorManager) return false; diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index feab53e93..c10a48fa3 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -40,7 +40,6 @@ #include "utils/booleanoptions.h" #include "utils/gettext.h" -#include "utils/stringutils.h" #include "debug.h" @@ -172,7 +171,7 @@ impHandler0(scrollChatDown) impHandler(msg) { std::string recvnick; - std::string msg; + std::string message; if (event.args.substr(0, 1) == "\"") { @@ -181,7 +180,7 @@ impHandler(msg) { recvnick = event.args.substr(1, pos - 1); if (pos + 2 < event.args.length()) - msg = event.args.substr(pos + 2, event.args.length()); + message = event.args.substr(pos + 2, event.args.length()); } } else @@ -191,18 +190,18 @@ impHandler(msg) { recvnick = event.args.substr(0, pos); if (pos + 1 < event.args.length()) - msg = event.args.substr(pos + 1, event.args.length()); + message = event.args.substr(pos + 1, event.args.length()); } else { recvnick = std::string(event.args); - msg.clear(); + message.clear(); } } - trim(msg); + trim(message); - if (msg.length() > 0) + if (message.length() > 0) { std::string playerName = localPlayer->getName(); std::string tempNick = recvnick; @@ -213,12 +212,13 @@ impHandler(msg) if (tempNick.compare(playerName) == 0 || event.args.empty()) return true; - chatWindow->addWhisper(recvnick, msg, ChatMsgType::BY_PLAYER); + chatWindow->addWhisper(recvnick, message, ChatMsgType::BY_PLAYER); } else { // TRANSLATORS: whisper send - event.tab->chatLog(_("Cannot send empty whispers!"), ChatMsgType::BY_SERVER); + event.tab->chatLog(_("Cannot send empty whispers!"), + ChatMsgType::BY_SERVER); } return true; } diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index daee32717..5a7e16334 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -46,7 +46,6 @@ #include "utils/chatutils.h" #include "utils/gettext.h" #include "utils/process.h" -#include "utils/stringutils.h" #include "debug.h" @@ -64,7 +63,8 @@ static std::string getNick(const InputEvent &event) if (!whisper || whisper->getNick().empty()) { // TRANSLATORS: change relation - event.tab->chatLog(_("Please specify a name."), ChatMsgType::BY_SERVER); + event.tab->chatLog(_("Please specify a name."), + ChatMsgType::BY_SERVER); return std::string(); } args = whisper->getNick(); @@ -151,7 +151,8 @@ impHandler(chatUnignore) if (event.tab) { // TRANSLATORS: unignore command - event.tab->chatLog(_("Player wasn't ignored!"), ChatMsgType::BY_SERVER); + event.tab->chatLog(_("Player wasn't ignored!"), + ChatMsgType::BY_SERVER); } return true; } @@ -176,7 +177,8 @@ impHandler(chatErase) if (event.tab) { // TRANSLATORS: erase command - event.tab->chatLog(_("Player already erased!"), ChatMsgType::BY_SERVER); + event.tab->chatLog(_("Player already erased!"), + ChatMsgType::BY_SERVER); } return true; } @@ -504,11 +506,11 @@ impHandler(url) { if (event.tab) { - std::string url = event.args; - if (!strStartWith(url, "http") && !strStartWith(url, "?")) - url = "http://" + url; + std::string url1 = event.args; + if (!strStartWith(url1, "http") && !strStartWith(url1, "?")) + url1 = "http://" + url1; std::string str(strprintf("[@@%s |%s@@]", - url.c_str(), event.args.c_str())); + url1.c_str(), event.args.c_str())); outStringNormal(event.tab, str, str); return true; } @@ -652,7 +654,7 @@ impHandler(hack) return true; } -impHandler0(debugSpawn) +impHandler(debugSpawn) { int cnt = atoi(event.args.c_str()); if (cnt < 1) diff --git a/src/actions/commands.h b/src/actions/commands.h index 1d6e5bd9d..46932681c 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -75,4 +75,4 @@ namespace Actions #undef decHandler -#endif // ACTIONS_CHAT_H +#endif // ACTIONS_COMMANDS_H diff --git a/src/actions/windows.cpp b/src/actions/windows.cpp index 4fcde2a52..edbadd5d0 100644 --- a/src/actions/windows.cpp +++ b/src/actions/windows.cpp @@ -97,7 +97,7 @@ static bool showHelpPage(const std::string &page, const bool showHide) return false; } -impHandler0(helpWindowShow) +impHandler(helpWindowShow) { if (!chatWindow || !chatWindow->isInputFocused()) return showHelpPage("index", true); diff --git a/src/actions/windows.h b/src/actions/windows.h index 9b0184feb..1c8293334 100644 --- a/src/actions/windows.h +++ b/src/actions/windows.h @@ -55,4 +55,4 @@ namespace Actions #undef decHandler -#endif // ACTIONS_ACTIONS_H +#endif // ACTIONS_WINDOWS_H |