From 549acdd072b732135dfa7b79015abf7340bef585 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 19 Dec 2014 16:05:51 +0300 Subject: Fix code style. --- src/actions/actions.cpp | 4 ++-- src/actions/chat.cpp | 2 +- src/actions/commands.cpp | 10 ++++++++-- src/gui/popups/popupmenu.cpp | 11 +---------- src/gui/widgets/browserbox.cpp | 2 -- src/gui/windows/charcreatedialog.cpp | 2 ++ src/gui/windows/inventorywindow.cpp | 4 ++-- src/gui/windows/updaterwindow.cpp | 2 +- src/net/eathena/beinghandler.cpp | 10 +++++----- src/resources/beinginfo.cpp | 9 ++++++--- src/utils/stringutils.cpp | 2 +- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index bd8431b31..003cd4a5d 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -567,7 +567,7 @@ impHandler0(copyEquippedToOutfit) return false; } -impHandler0(pickup) +impHandler(pickup) { if (!localPlayer) return false; @@ -653,7 +653,7 @@ impHandler(sell) return false; } -impHandler0(talk) +impHandler(talk) { Being *being = findBeing(event.args); if (!being) diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index b074fc9ff..5891243b3 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -450,7 +450,7 @@ impHandler(kickParty) return true; } -impHandler0(addText) +impHandler(addText) { if (chatWindow) chatWindow->addInputText(event.args); diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index b90a801d1..d2155d54b 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -22,7 +22,6 @@ #include "actormanager.h" #include "configuration.h" -#include "flooritem.h" #include "game.h" #include "inventory.h" #include "item.h" @@ -494,11 +493,18 @@ impHandler(imitation) return false; if (!event.args.empty()) + { localPlayer->setImitate(event.args); + } else if (event.tab && event.tab->getType() == ChatTabType::WHISPER) - localPlayer->setImitate(static_cast(event.tab)->getNick()); + { + localPlayer->setImitate(static_cast( + event.tab)->getNick()); + } else + { localPlayer->setImitate(""); + } return true; } diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 25e48708c..bccec33af 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -25,7 +25,6 @@ #include "actormanager.h" #include "configuration.h" #include "dropshortcut.h" -#include "game.h" #include "gamemodifiers.h" #include "guild.h" #include "guildmanager.h" @@ -46,11 +45,9 @@ #include "gui/windows/chatwindow.h" #include "gui/windows/equipmentwindow.h" #include "gui/windows/inventorywindow.h" -#include "gui/windows/itemamountwindow.h" #include "gui/windows/ministatuswindow.h" #include "gui/windows/npcdialog.h" #include "gui/windows/outfitwindow.h" -#include "gui/windows/skilldialog.h" #include "gui/windows/socialwindow.h" #include "gui/windows/textcommandeditor.h" #include "gui/windows/textdialog.h" @@ -68,22 +65,16 @@ #include "net/adminhandler.h" #include "net/beinghandler.h" -#include "net/buysellhandler.h" #include "net/chathandler.h" #include "net/guildhandler.h" #include "net/homunculushandler.h" -#include "net/inventoryhandler.h" #include "net/mercenaryhandler.h" -#include "net/npchandler.h" -#include "net/partyhandler.h" #include "net/pethandler.h" #include "net/serverfeatures.h" -#include "net/tradehandler.h" #include "resources/chatobject.h" #include "resources/iteminfo.h" #include "resources/mapitemtype.h" -#include "resources/skillconsts.h" #include "resources/db/npcdb.h" @@ -1565,7 +1556,7 @@ void PopupMenu::handleLink(const std::string &link, if (id >= 0) inputManager.executeAction(id); } - else if(!link.empty() && link[0] == '/') + else if (!link.empty() && link[0] == '/') { std::string cmd = link.substr(1); replaceAll(cmd, "'NAME'", mNick); diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index ff6fe2a8a..92892d6f4 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -928,8 +928,6 @@ void BrowserBox::moveSelectionUp() mSelectedLink --; } -#include "logger.h" - void BrowserBox::moveSelectionDown() { mSelectedLink ++; diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 05dfb2171..2380c694e 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -52,6 +52,8 @@ #include "debug.h" +#undef ERROR + static const BeingAction::Action actions[] = { BeingAction::STAND, diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 7cf268b0f..3f2414e9f 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -763,14 +763,14 @@ InventoryWindow *InventoryWindow::getFirstVisible() void InventoryWindow::nextTab() { - InventoryWindow *const window = getFirstVisible(); + const InventoryWindow *const window = getFirstVisible(); if (window) window->mFilter->nextTab(); } void InventoryWindow::prevTab() { - InventoryWindow *const window = getFirstVisible(); + const InventoryWindow *const window = getFirstVisible(); if (window) window->mFilter->prevTab(); } diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 5fc5420ee..827bd3550 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -1044,7 +1044,7 @@ bool UpdaterWindow::validateFile(const std::string &filePath, unsigned long UpdaterWindow::getFileHash(const std::string &filePath) { int size = 0; - char *const buf = static_cast(PhysFs::loadFile(filePath, size)); + const char *const buf = static_cast(PhysFs::loadFile(filePath, size)); if (!buf) return 0; return Net::Download::adlerBuffer(buf, size); diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 06c0be6b9..18cf7d8a6 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -24,9 +24,7 @@ #include "actormanager.h" #include "effectmanager.h" -#include "guild.h" #include "guildmanager.h" -#include "party.h" #include "being/localplayer.h" #include "being/mercenaryinfo.h" @@ -432,14 +430,16 @@ void BeingHandler::processBeingChangeLookContinue(Being *const dstBeing, static_cast(id2)); localPlayer->imitateOutfit(dstBeing, SPRITE_CLOTHES_COLOR); break; - case 5: // LOOK_HEAD_MID Change middle headgear for eathena, armor for us + case 5: // LOOK_HEAD_MID Change middle headgear for eathena, + // armor for us dstBeing->setSprite(SPRITE_HEAD_BOTTOM, id, color, static_cast(id2)); localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_BOTTOM); break; case 6: // eAthena LOOK_HAIR_COLOR - dstBeing->setSpriteColor(SPRITE_HAIR_COLOR, ItemDB::get( - dstBeing->getSpriteID(SPRITE_HAIR_COLOR)).getDyeColorsString(id)); + dstBeing->setSpriteColor(SPRITE_HAIR_COLOR, + ItemDB::get(dstBeing->getSpriteID( + SPRITE_HAIR_COLOR)).getDyeColorsString(id)); break; case 7: // Clothes color // ignoring it diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index ad10f5628..45496551d 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -52,9 +52,12 @@ BeingInfo::BeingInfo() : mHoverCursor(Cursor::CURSOR_POINTER), mSounds(), mAttacks(), - mBlockWalkMask(BlockMask::WALL | BlockMask::CHARACTER - | BlockMask::MONSTER | BlockMask::AIR - | BlockMask::WATER), + mMenu(), + mBlockWalkMask(BlockMask::WALL + | BlockMask::CHARACTER + | BlockMask::MONSTER + | BlockMask::AIR + | BlockMask::WATER), mBlockType(BlockType::CHARACTER), mColors(nullptr), mTargetOffsetX(0), diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 6dd11160b..4aa8f5619 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -764,7 +764,7 @@ uint32_t parseNumber(const std::string &str) std::string removeToken(std::string &str, const std::string &token) { - int idx = str.find(token); + const size_t idx = str.find(token); if (idx > 0) str = str.substr(idx + 1); else -- cgit v1.2.3-70-g09d2