diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-09 22:10:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-09 22:11:30 +0300 |
commit | 703a3c4df3732e3e88559147001260f3355d42d6 (patch) | |
tree | fcaf8919cf734429374e4bb9a83b2b4a33835d1d /src | |
parent | 3a875a0026936d4bcb3bd1c2b6e8ac547cd5e27e (diff) | |
download | mv-703a3c4df3732e3e88559147001260f3355d42d6.tar.gz mv-703a3c4df3732e3e88559147001260f3355d42d6.tar.bz2 mv-703a3c4df3732e3e88559147001260f3355d42d6.tar.xz mv-703a3c4df3732e3e88559147001260f3355d42d6.zip |
Continue fix for shadow variables/methods errors.
Diffstat (limited to 'src')
40 files changed, 166 insertions, 169 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp index 1104f034a..3acb63dc3 100644 --- a/src/actorspritemanager.cpp +++ b/src/actorspritemanager.cpp @@ -257,7 +257,6 @@ void ActorSpriteManager::undelete(ActorSprite *actor) for (it = mDeleteActors.begin(), it_end = mDeleteActors.end(); it != it_end; ++it) { - ActorSprite *actor = *it; if (*it == actor) { mDeleteActors.erase(*it); @@ -906,15 +905,15 @@ bool ActorSpriteManager::validateBeing(Being *aroundBeing, Being* being, || player_node->isReachable(being, maxCost)); } -void ActorSpriteManager::healTarget(LocalPlayer* player_node) +void ActorSpriteManager::healTarget() { if (!player_node) return; - heal(player_node, player_node->getTarget()); + heal(player_node->getTarget()); } -void ActorSpriteManager::heal(LocalPlayer* player_node, Being* target) +void ActorSpriteManager::heal(Being* target) { if (!player_node || !chatWindow || !player_node->isAlive() || !Net::getPlayerHandler()->canUseMagic()) diff --git a/src/actorspritemanager.h b/src/actorspritemanager.h index 91503e1c3..bd2ae79fb 100644 --- a/src/actorspritemanager.h +++ b/src/actorspritemanager.h @@ -164,9 +164,9 @@ class ActorSpriteManager: public ConfigListener // void HealAllTargets(Being *aroundBeing, int maxdist, // Being::Type type) const; - void healTarget(LocalPlayer* player_node); + void healTarget(); - void heal(LocalPlayer* player_node, Being* target); + void heal(Being* target); void itenplz(); diff --git a/src/client.cpp b/src/client.cpp index b9e9735c9..be1c00197 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -196,16 +196,16 @@ Uint32 nextSecond(Uint32 interval, void *param A_UNUSED) * @return the elapsed time in milliseconds * between two tick values. */ -int get_elapsed_time(int start_time) +int get_elapsed_time(int startTime) { - if (start_time <= tick_time) + if (startTime <= tick_time) { - return (tick_time - start_time) * MILLISECONDS_IN_A_TICK; + return (tick_time - startTime) * MILLISECONDS_IN_A_TICK; } else { - return (tick_time + (MAX_TICK_VALUE - start_time)) - * MILLISECONDS_IN_A_TICK; + return (tick_time + (MAX_TICK_VALUE - startTime)) + * MILLISECONDS_IN_A_TICK; } } @@ -845,10 +845,10 @@ int Client::exec() if (mState != mOldState) { { - Mana::Event event(EVENT_STATECHANGE); - event.setInt("oldState", mOldState); - event.setInt("newState", mState); - Mana::Event::trigger(CHANNEL_CLIENT, event); + Mana::Event evt(EVENT_STATECHANGE); + evt.setInt("oldState", mOldState); + evt.setInt("newState", mState); + Mana::Event::trigger(CHANNEL_CLIENT, evt); } if (mOldState == STATE_GAME) @@ -1046,10 +1046,10 @@ int Client::exec() if (!BeingInfo::unknown) BeingInfo::unknown = new BeingInfo; - Mana::Event event(EVENT_STATECHANGE); - event.setInt("newState", STATE_LOAD_DATA); - event.setInt("oldState", mOldState); - Mana::Event::trigger(CHANNEL_CLIENT, event); + Mana::Event evt(EVENT_STATECHANGE); + evt.setInt("newState", STATE_LOAD_DATA); + evt.setInt("oldState", mOldState); + Mana::Event::trigger(CHANNEL_CLIENT, evt); // Load XML databases ColorDB::load(); @@ -1733,27 +1733,27 @@ void Client::initScreenshotDir() } } -void Client::accountLogin(LoginData *loginData) +void Client::accountLogin(LoginData *data) { - if (!loginData) + if (!data) return; - logger->log("Username is %s", loginData->username.c_str()); + logger->log("Username is %s", data->username.c_str()); // Send login infos - if (loginData->registerLogin) - Net::getLoginHandler()->registerAccount(loginData); + if (data->registerLogin) + Net::getLoginHandler()->registerAccount(data); else - Net::getLoginHandler()->loginAccount(loginData); + Net::getLoginHandler()->loginAccount(data); // Clear the password, avoids auto login when returning to login - loginData->password = ""; + data->password = ""; // TODO This is not the best place to save the config, but at least better // than the login gui window - if (loginData->remember) - serverConfig.setValue("username", loginData->username); - serverConfig.setValue("remember", loginData->remember); + if (data->remember) + serverConfig.setValue("username", data->username); + serverConfig.setValue("remember", data->remember); } bool Client::copyFile(std::string &configPath, std::string &oldConfigPath) @@ -1805,7 +1805,7 @@ void Client::storeSafeParameters() int width; int height; std::string font; - std::string boldFont; + std::string bFont; std::string particleFont; std::string helpFont; std::string secureFont; @@ -1833,7 +1833,7 @@ void Client::storeSafeParameters() height = config.getIntValue("screenheight"); font = config.getStringValue("font"); - boldFont = config.getStringValue("boldFont"); + bFont = config.getStringValue("boldFont"); particleFont = config.getStringValue("particleFont"); helpFont = config.getStringValue("helpFont"); secureFont = config.getStringValue("secureFont"); @@ -1878,7 +1878,7 @@ void Client::storeSafeParameters() config.setValue("screenwidth", width); config.setValue("screenheight", height); config.setValue("font", font); - config.setValue("boldFont", boldFont); + config.setValue("boldFont", bFont); config.setValue("particleFont", particleFont); config.setValue("helpFont", helpFont); config.setValue("secureFont", secureFont); diff --git a/src/client.h b/src/client.h index 3edf12674..4409cf8db 100644 --- a/src/client.h +++ b/src/client.h @@ -78,7 +78,7 @@ extern LoginData loginData; /** * Returns elapsed time. (Warning: supposes the delay is always < 100 seconds) */ -int get_elapsed_time(int start_time); +int get_elapsed_time(int startTime); /** * All client states. @@ -291,7 +291,7 @@ private: bool copyFile(std::string &configPath, std::string &oldConfigPath); bool createConfig(std::string &configPath); - void accountLogin(LoginData *loginData); + void accountLogin(LoginData *data); void storeSafeParameters(); diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index dc962a17d..d16a7db27 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -397,7 +397,7 @@ void CommandHandler::handleMsg(const std::string &args, ChatTab *tab) if (tempNick.compare(playerName) == 0 || args.empty()) return; - chatWindow->whisper(recvnick, msg, BY_PLAYER); + chatWindow->addWhisper(recvnick, msg, BY_PLAYER); } else tab->chatLog(_("Cannot send empty whispers!"), BY_SERVER); @@ -851,11 +851,11 @@ void CommandHandler::handleHeal(const std::string &args, ChatTab *tab A_UNUSED) Being *being = actorSpriteManager->findBeingByName( args, Being::PLAYER); if (being) - actorSpriteManager->heal(player_node, being); + actorSpriteManager->heal(being); } else { - actorSpriteManager->heal(player_node, player_node); + actorSpriteManager->heal(player_node); } } diff --git a/src/game.cpp b/src/game.cpp index a0635f42f..3c7579d78 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -972,7 +972,7 @@ void Game::handleInput() break; case KeyboardConfig::KEY_MAGIC_INMA1: - actorSpriteManager->healTarget(player_node); + actorSpriteManager->healTarget(); setValidSpeed(); break; @@ -1094,7 +1094,7 @@ void Game::handleInput() && !keyboard.isKeyActive(keyboard.KEY_TARGET) && !InventoryWindow::isAnyInputFocused()) { - const int tKey = keyboard.getKeyIndex(event.key.keysym.sym); +// const int tKey = keyboard.getKeyIndex(event.key.keysym.sym); if (setupWindow->isVisible()) { diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index c52511189..f3e4b88b8 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -907,9 +907,9 @@ void ChatWindow::addItemText(const std::string &item) addInputText(text.str()); } -void ChatWindow::setVisible(bool isVisible) +void ChatWindow::setVisible(bool visible) { - Window::setVisible(isVisible); + Window::setVisible(visible); /* * For whatever reason, if setVisible is called, the mTmpVisible effect @@ -918,8 +918,8 @@ void ChatWindow::setVisible(bool isVisible) mTmpVisible = false; } -void ChatWindow::whisper(const std::string &nick, - const std::string &mes, Own own) +void ChatWindow::addWhisper(const std::string &nick, + const std::string &mes, Own own) { if (mes.empty() || !player_node) return; diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index 97e366701..1ad468a3b 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -222,8 +222,8 @@ class ChatWindow : public Window, void doPresent(); - void whisper(const std::string &nick, const std::string &mes, - Own own = BY_OTHER); + void addWhisper(const std::string &nick, const std::string &mes, + Own own = BY_OTHER); ChatTab *addWhisperTab(const std::string &nick, bool switchTo = false); diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index da1c45782..c6afaaf1d 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -362,17 +362,12 @@ void InventoryWindow::action(const gcn::ActionEvent &event) else if (event.getId() == "split") { ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item, - (item->getQuantity() - 1)); + (item->getQuantity() - 1)); } else if (event.getId() == "retrieve") { - Item *item = mItems->getSelectedItem(); - - if (!item) - return; - - ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, this, - item); + ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, + this, item); } } diff --git a/src/gui/itemamountwindow.cpp b/src/gui/itemamountwindow.cpp index 059f3d785..9bd3f3ab3 100644 --- a/src/gui/itemamountwindow.cpp +++ b/src/gui/itemamountwindow.cpp @@ -53,11 +53,11 @@ class ItemsModal : public gcn::ListModel public: ItemsModal() { - std::map<int, ItemInfo*> info = ItemDB::getItemInfos(); + std::map<int, ItemInfo*> items = ItemDB::getItemInfos(); std::list<std::string> tempStrings; for (std::map<int, ItemInfo*>::const_iterator - i = info.begin(), i_end = info.end(); + i = items.begin(), i_end = items.end(); i != i_end; ++i) { if (i->first < 0) diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp index ab5dc7401..adf499f75 100644 --- a/src/gui/logindialog.cpp +++ b/src/gui/logindialog.cpp @@ -81,10 +81,10 @@ public: } }; -LoginDialog::LoginDialog(LoginData *loginData, std::string serverName, +LoginDialog::LoginDialog(LoginData *data, std::string serverName, std::string *updateHost): Window(_("Login")), - mLoginData(loginData), + mLoginData(data), mUpdateHost(updateHost), mServerName(serverName) { @@ -94,7 +94,7 @@ LoginDialog::LoginDialog(LoginData *loginData, std::string serverName, gcn::Label *userLabel = new Label(_("Name:")); gcn::Label *passLabel = new Label(_("Password:")); mCustomUpdateHost = new CheckBox(_("Custom update host"), - loginData->updateType & LoginData::Upd_Custom, this, "customhost"); + mLoginData->updateType & LoginData::Upd_Custom, this, "customhost"); mUpdateHostText = new TextField(serverConfig.getValue( "customUpdateHost", "")); @@ -112,7 +112,7 @@ LoginDialog::LoginDialog(LoginData *loginData, std::string serverName, mUpdateTypeModel = new UpdateTypeModel(); mUpdateTypeDropDown = new DropDown(mUpdateTypeModel); mUpdateTypeDropDown->setActionEventId("updatetype"); - mUpdateTypeDropDown->setSelected((loginData->updateType + mUpdateTypeDropDown->setSelected((mLoginData->updateType | LoginData::Upd_Custom) ^ LoginData::Upd_Custom); if (!mCustomUpdateHost->isSelected()) diff --git a/src/gui/logindialog.h b/src/gui/logindialog.h index e464c6f24..0696bc680 100644 --- a/src/gui/logindialog.h +++ b/src/gui/logindialog.h @@ -49,7 +49,7 @@ class LoginDialog : public Window, public gcn::ActionListener, * * @see Window::Window */ - LoginDialog(LoginData *loginData, std::string serverName, + LoginDialog(LoginData *data, std::string serverName, std::string *updateHost); ~LoginDialog(); diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp index b325bcef6..e3f441b60 100644 --- a/src/gui/ministatuswindow.cpp +++ b/src/gui/ministatuswindow.cpp @@ -400,12 +400,12 @@ void MiniStatusWindow::mouseExited(gcn::MouseEvent &event) mStatusPopup->hide(); } -void MiniStatusWindow::showBar(std::string name, bool isVisible) +void MiniStatusWindow::showBar(std::string name, bool visible) { ProgressBar *bar = mBarNames[name]; if (!bar) return; - bar->setVisible(isVisible); + bar->setVisible(visible); updateBars(); saveBars(); } diff --git a/src/gui/ministatuswindow.h b/src/gui/ministatuswindow.h index 91aebcfac..5e1b442dc 100644 --- a/src/gui/ministatuswindow.h +++ b/src/gui/ministatuswindow.h @@ -80,7 +80,7 @@ class MiniStatusWindow : public Popup, void mouseExited(gcn::MouseEvent &event); - void showBar(std::string name, bool isVisible); + void showBar(std::string name, bool visible); void updateBars(); diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 7e43c9954..e43ab35bc 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -879,7 +879,7 @@ void PopupMenu::handleLink(const std::string &link, } else if (link == "heal" && being && being->getType() != Being::MONSTER) { - actorSpriteManager->heal(player_node, being); + actorSpriteManager->heal(being); } else if (link == "unignore" && being && being->getType() == ActorSprite::PLAYER) @@ -1591,12 +1591,15 @@ void PopupMenu::handleLink(const std::string &link, } else if (!link.compare(0, 7, "player_")) { - mBeingId = atoi(link.substr(7).c_str()); - Being *being = actorSpriteManager->findBeing(mBeingId); - if (being) + if (actorSpriteManager) { - showPopup(getX(), getY(), being); - return; + mBeingId = atoi(link.substr(7).c_str()); + being = actorSpriteManager->findBeing(mBeingId); + if (being) + { + showPopup(getX(), getY(), being); + return; + } } } else if (!link.compare(0, 12, "hide button_")) diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 913c958f2..e2c718359 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -62,21 +62,21 @@ void WrongDataNoticeListener::action(const gcn::ActionEvent &event) mTarget->requestFocus(); } -RegisterDialog::RegisterDialog(LoginData *loginData): +RegisterDialog::RegisterDialog(LoginData *data): Window(_("Register")), mEmailField(0), mMaleButton(0), mFemaleButton(0), mWrongDataNoticeListener(new WrongDataNoticeListener), - mLoginData(loginData) + mLoginData(data) { int optionalActions = Net::getLoginHandler()->supportedOptionalActions(); gcn::Label *userLabel = new Label(_("Name:")); gcn::Label *passwordLabel = new Label(_("Password:")); gcn::Label *confirmLabel = new Label(_("Confirm:")); - mUserField = new TextField(loginData->username); - mPasswordField = new PasswordField(loginData->password); + mUserField = new TextField(mLoginData->username); + mPasswordField = new PasswordField(mLoginData->password); mConfirmField = new PasswordField; mRegisterButton = new Button(_("Register"), "register", this); mCancelButton = new Button(_("Cancel"), "cancel", this); @@ -161,7 +161,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) const std::string user = mUserField->getText(); logger->log("RegisterDialog::register Username is %s", user.c_str()); - std::string errorMessage; + std::string errorMsg; int error = 0; unsigned int minUser = Net::getLoginHandler()->getMinUserNameLength(); @@ -172,7 +172,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) if (user.length() < minUser) { // Name too short - errorMessage = strprintf + errorMsg = strprintf (_("The username needs to be at least %d characters long."), minUser); error = 1; @@ -180,7 +180,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (user.length() > maxUser - 1 ) { // Name too long - errorMessage = strprintf + errorMsg = strprintf (_("The username needs to be less than %d characters long."), maxUser); error = 1; @@ -188,7 +188,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText().length() < minPass) { // Pass too short - errorMessage = strprintf + errorMsg = strprintf (_("The password needs to be at least %d characters long."), minPass); error = 2; @@ -196,7 +196,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText().length() > maxPass - 1 ) { // Pass too long - errorMessage = strprintf + errorMsg = strprintf (_("The password needs to be less than %d characters long."), maxPass); error = 2; @@ -204,7 +204,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText() != mConfirmField->getText()) { // Password does not match with the confirmation one - errorMessage = _("Passwords do not match."); + errorMsg = _("Passwords do not match."); error = 2; } @@ -225,7 +225,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) mWrongDataNoticeListener->setTarget(this->mPasswordField); } - OkDialog *dlg = new OkDialog(_("Error"), errorMessage); + OkDialog *dlg = new OkDialog(_("Error"), errorMsg); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index 8dd7f929d..b196ae4e4 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -48,8 +48,8 @@ char *strBuf; class SDLTextChunk { public: - SDLTextChunk(const std::string &text, const gcn::Color &color) : - img(0), text(text), color(color) + SDLTextChunk(const std::string &text0, const gcn::Color &color0) : + img(0), text(text0), color(color0) { } diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 763c190d6..f9d6ebfd0 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -548,7 +548,7 @@ void ServerDialog::mouseClicked(gcn::MouseEvent &mouseEvent) void ServerDialog::logic() { { - MutexLocker lock(&mMutex); + MutexLocker tempLock(&mMutex); if (mDownloadStatus == DOWNLOADING_COMPLETE) { mDownloadStatus = DOWNLOADING_OVER; @@ -636,11 +636,11 @@ void ServerDialog::loadServers(bool addNew) return; } - int version = XML::getProperty(rootNode, "version", 0); - if (version != 1) + int ver = XML::getProperty(rootNode, "version", 0); + if (ver != 1) { logger->log("Error: unsupported online server list version: %d", - version); + ver); return; } @@ -703,7 +703,7 @@ void ServerDialog::loadServers(bool addNew) server.version.first = gui->getFont()->getWidth(version); server.version.second = version; - MutexLocker lock(&mMutex); + MutexLocker tempLock(&mMutex); // Add the server to the local list if it's not already present bool found = false; for (unsigned int i = 0; i < mServers.size(); i++) diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 7bbcd9a2c..bc210075a 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -478,20 +478,20 @@ void Setup_Video::apply() fullscreen = !fullscreen; if (!mainGraphics->setFullscreen(fullscreen)) { - std::stringstream errorMessage; + std::stringstream errorMsg; if (fullscreen) { - errorMessage << _("Failed to switch to windowed mode " - "and restoration of old mode also " - "failed!") << std::endl; + errorMsg << _("Failed to switch to windowed mode " + "and restoration of old mode also " + "failed!") << std::endl; } else { - errorMessage << _("Failed to switch to fullscreen mode" - " and restoration of old mode also " - "failed!") << std::endl; + errorMsg << _("Failed to switch to fullscreen mode" + " and restoration of old mode also " + "failed!") << std::endl; } - logger->error(errorMessage.str()); + logger->error(errorMsg.str()); } } #if defined(WIN32) || defined(__APPLE__) diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index 5cf1573bb..c62c3254c 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -596,7 +596,7 @@ void ShopWindow::sendMessage(const std::string &nick, if (config.getBoolValue("hideShopMessages")) Net::getChatHandler()->privateMessage(nick, data); else if (chatWindow) - chatWindow->whisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, BY_PLAYER); //here was true } diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index 7feca8bf4..886894564 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -962,7 +962,7 @@ public: { name = *i; } - Avatar *ava = new Avatar(name); + ava = new Avatar(name); ava->setOnline(true); ava->setLevel(level); ava->setType(MapItem::PRIORITY); @@ -997,7 +997,7 @@ public: { name = *i; } - Avatar *ava = new Avatar(name); + ava = new Avatar(name); ava->setOnline(true); ava->setLevel(level); ava->setType(MapItem::ATTACK); @@ -1032,7 +1032,7 @@ public: { name = *i; } - Avatar *ava = new Avatar(name); + ava = new Avatar(name); ava->setOnline(false); ava->setLevel(level); ava->setType(MapItem::IGNORE_); diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp index 9d759c4a2..1e18da57a 100644 --- a/src/gui/textcommandeditor.cpp +++ b/src/gui/textcommandeditor.cpp @@ -61,11 +61,11 @@ class IconsModal : public gcn::ListModel public: IconsModal() { - std::map<int, ItemInfo*> info = ItemDB::getItemInfos(); + std::map<int, ItemInfo*> items = ItemDB::getItemInfos(); std::list<std::string> tempStrings; for (std::map<int, ItemInfo*>::const_iterator - i = info.begin(), i_end = info.end(); + i = items.begin(), i_end = items.end(); i != i_end; ++i) { if (i->first < 0) diff --git a/src/gui/tradewindow.cpp b/src/gui/tradewindow.cpp index 3c19ee9c2..d0ae67746 100644 --- a/src/gui/tradewindow.cpp +++ b/src/gui/tradewindow.cpp @@ -443,10 +443,10 @@ void TradeWindow::initTrade(std::string nick) bool TradeWindow::checkItem(Item *item) { - Item *tradeItem = mMyInventory->findItem( + Item *tItem = mMyInventory->findItem( item->getId(), item->getColor()); - if (tradeItem && (tradeItem->getQuantity() > 1 + if (tItem && (tItem->getQuantity() > 1 || item->getQuantity() > 1)) { if (localChatTab) diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp index 568e0613e..e875000c4 100644 --- a/src/gui/unregisterdialog.cpp +++ b/src/gui/unregisterdialog.cpp @@ -46,10 +46,10 @@ #include "debug.h" -UnRegisterDialog::UnRegisterDialog(LoginData *loginData): +UnRegisterDialog::UnRegisterDialog(LoginData *data): Window(_("Unregister"), true), mWrongDataNoticeListener(new WrongDataNoticeListener), - mLoginData(loginData) + mLoginData(data) { gcn::Label *userLabel = new Label(strprintf(_("Name: %s"), mLoginData-> username.c_str())); @@ -108,7 +108,7 @@ void UnRegisterDialog::action(const gcn::ActionEvent &event) logger->log("UnregisterDialog::unregistered, Username is %s", username.c_str()); - std::stringstream errorMessage; + std::stringstream errorMsg; bool error = false; unsigned int min = Net::getLoginHandler()->getMinPasswordLength(); @@ -118,15 +118,15 @@ void UnRegisterDialog::action(const gcn::ActionEvent &event) if (password.length() < min) { // Pass too short - errorMessage << strprintf(_("The password needs to be at least %d " - "characters long."), min); + errorMsg << strprintf(_("The password needs to be at least %d " + "characters long."), min); error = true; } else if (password.length() > max - 1) { // Pass too long - errorMessage << strprintf(_("The password needs to be less than " - "%d characters long."), max); + errorMsg << strprintf(_("The password needs to be less than " + "%d characters long."), max); error = true; } @@ -134,7 +134,7 @@ void UnRegisterDialog::action(const gcn::ActionEvent &event) { mWrongDataNoticeListener->setTarget(this->mPasswordField); - OkDialog *dlg = new OkDialog(_("Error"), errorMessage.str()); + OkDialog *dlg = new OkDialog(_("Error"), errorMsg.str()); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 073697459..461dd581d 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -489,7 +489,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) if (actorSpriteManager) { if (player_node != mHoverBeing || mSelfMouseHeal) - actorSpriteManager->heal(player_node, mHoverBeing); + actorSpriteManager->heal(mHoverBeing); } } else if (player_node->withinAttackRange(mHoverBeing) || diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 29fca7662..18dc48417 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -330,7 +330,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) Being* being = actorSpriteManager->findBeingByName(ava->getName(), Being::PLAYER); if (being) - actorSpriteManager->heal(player_node, being); + actorSpriteManager->heal(being); } else { diff --git a/src/gui/widgets/mouseevent.h b/src/gui/widgets/mouseevent.h index 5e9a46cfd..9484be0a5 100644 --- a/src/gui/widgets/mouseevent.h +++ b/src/gui/widgets/mouseevent.h @@ -28,12 +28,12 @@ class MouseEvent : public gcn::MouseEvent { public: - MouseEvent(gcn::Widget* source, bool isShiftPressed, - bool isControlPressed, bool isAltPressed, - bool isMetaPressed, unsigned int type, unsigned int button, + MouseEvent(gcn::Widget* source, bool shiftPressed, + bool controlPressed, bool altPressed, + bool metaPressed, unsigned int type, unsigned int button, int x, int y, int clickCount) : - gcn::MouseEvent(source, isShiftPressed, isControlPressed, - isAltPressed, isMetaPressed, type, button, x, y, + gcn::MouseEvent(source, shiftPressed, controlPressed, + altPressed, metaPressed, type, button, x, y, clickCount) { } diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index eaec791ee..487035350 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -315,13 +315,13 @@ void WindowMenu::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) mTextPopup->hide(); } -void WindowMenu::showButton(std::string name, bool isVisible) +void WindowMenu::showButton(std::string name, bool visible) { Button *btn = dynamic_cast<Button*>(mButtonNames[name]); if (!btn) return; - btn->setVisible(isVisible); + btn->setVisible(visible); updateButtons(); saveButtons(); } diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index 6572fe470..739a302ba 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -72,7 +72,7 @@ class WindowMenu : public Container, std::vector <gcn::Button*> &getButtons() { return mButtons; } - void showButton(std::string name, bool isVisible); + void showButton(std::string name, bool visible); void loadButtons(); diff --git a/src/localplayer.cpp b/src/localplayer.cpp index fdbc4b0b7..b19b1b9af 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -3674,9 +3674,9 @@ void LocalPlayer::followMoveTo(Being *being, int x1, int y1, int x2, int y2) { if (actorSpriteManager) { - Being *being = actorSpriteManager->findBeingByName( - mPlayerFollowed, Being::PLAYER); - setTarget(being); + Being *b = actorSpriteManager->findBeingByName( + mPlayerFollowed, Being::PLAYER); + setTarget(b); } } moveToTarget(); diff --git a/src/map.cpp b/src/map.cpp index e5b3632b6..86d1171f0 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -114,10 +114,10 @@ void TileAnimation::update(int ticks) } } -MapLayer::MapLayer(int x, int y, int width, int height, bool isFringeLayer): +MapLayer::MapLayer(int x, int y, int width, int height, bool fringeLayer): mX(x), mY(y), mWidth(width), mHeight(height), - mIsFringeLayer(isFringeLayer), + mIsFringeLayer(fringeLayer), mHighlightAttackRange(config.getBoolValue("highlightAttackRange")) { const int size = mWidth * mHeight; @@ -1592,9 +1592,9 @@ void Map::addParticleEffect(const std::string &effectFile, particleEffects.push_back(newEffect); } -void Map::initializeParticleEffects(Particle *particleEngine) +void Map::initializeParticleEffects(Particle *engine) { - if (!particleEngine) + if (!engine) return; Particle *p; @@ -1605,7 +1605,7 @@ void Map::initializeParticleEffects(Particle *particleEngine) i = particleEffects.begin(); i != particleEffects.end(); ++i) { - p = particleEngine->addEffect(i->file, i->x, i->y); + p = engine->addEffect(i->file, i->x, i->y); if (p && i->w > 0 && i->h > 0) p->adjustEmitterSize(i->w, i->h); } diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index 685562d6f..f38d17a59 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -70,7 +70,7 @@ void BuySellHandler::requestSellList(std::string nick) else { if (chatWindow) - chatWindow->whisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, BY_PLAYER); } } @@ -89,7 +89,7 @@ void BuySellHandler::requestBuyList(std::string nick) else { if (chatWindow) - chatWindow->whisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, BY_PLAYER); } } @@ -102,12 +102,12 @@ void BuySellHandler::sendBuyRequest(std::string nick, ShopItem* item, return; } std::string data = strprintf("!buyitem %d %d %d", - item->getId(), item->getPrice(), amount); + item->getId(), item->getPrice(), amount); if (config.getBoolValue("hideShopMessages")) Net::getChatHandler()->privateMessage(nick, data); else - chatWindow->whisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, BY_PLAYER); } void BuySellHandler::sendSellRequest(std::string nick, ShopItem* item, @@ -120,12 +120,12 @@ void BuySellHandler::sendSellRequest(std::string nick, ShopItem* item, } std::string data = strprintf("!sellitem %d %d %d", - item->getId(), item->getPrice(), amount); + item->getId(), item->getPrice(), amount); if (config.getBoolValue("hideShopMessages")) Net::getChatHandler()->privateMessage(nick, data); else - chatWindow->whisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, BY_PLAYER); } void BuySellHandler::processNpcBuySellChoice(Net::MessageIn &msg) diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 5737cc2b2..c18b1bb9a 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -125,7 +125,7 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) case 0x01: if (chatWindow) { - chatWindow->whisper(nick, + chatWindow->addWhisper(nick, strprintf(_("Whisper could not be " "sent, %s is offline."), nick.c_str()), BY_SERVER); } @@ -133,7 +133,7 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) case 0x02: if (chatWindow) { - chatWindow->whisper(nick, + chatWindow->addWhisper(nick, strprintf(_("Whisper could not " "be sent, ignored by %s."), nick.c_str()), BY_SERVER); @@ -183,7 +183,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) if (tradeBot) { if (showMsg && chatWindow) - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); shopWindow->giveList(nick, ShopWindow::SELL); } @@ -193,7 +193,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) if (tradeBot) { if (showMsg && chatWindow) - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); shopWindow->giveList(nick, ShopWindow::BUY); } @@ -201,7 +201,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) else if (chatMsg.find("!buyitem ") == 0) { if (showMsg && chatWindow) - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); if (tradeBot) { shopWindow->processRequest(nick, chatMsg, @@ -211,7 +211,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) else if (chatMsg.find("!sellitem ") == 0) { if (showMsg && chatWindow) - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); if (tradeBot) { shopWindow->processRequest(nick, chatMsg, @@ -223,7 +223,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) { chatMsg = chatMsg.erase(0, 2); if (showMsg && chatWindow) - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); if (chatMsg.find("B1") == 0 || chatMsg.find("S1") == 0) { @@ -232,12 +232,12 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) } else if (chatWindow) { - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); } } else if (chatWindow) { - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); } } else @@ -246,7 +246,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) || (chatMsg.find("!selllist") != 0 && chatMsg.find("!buylist") != 0))) { - chatWindow->whisper(nick, chatMsg); + chatWindow->addWhisper(nick, chatMsg); } } } diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index 4be4ddaa6..cb1e84673 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -114,15 +114,15 @@ class InventoryItem int refine; bool equip; - InventoryItem(int slot, int id, int quantity, int refine, - unsigned char color, bool equip) + InventoryItem(int slot0, int id0, int quantity0, int refine0, + unsigned char color0, bool equip0) { - this->slot = slot; - this->id = id; - this->quantity = quantity; - this->refine = refine; - this->color = color; - this->equip = equip; + slot = slot0; + id = id0; + quantity = quantity0; + refine = refine0; + color = color0; + equip = equip0; } }; diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp index 85323b11a..16552018e 100644 --- a/src/net/manaserv/chathandler.cpp +++ b/src/net/manaserv/chathandler.cpp @@ -231,7 +231,7 @@ void ChatHandler::handlePrivateMessage(Net::MessageIn &msg) std::string userNick = msg.readString(); std::string chatMsg = msg.readString(); - chatWindow->whisper(userNick, chatMsg); + chatWindow->addWhisper(userNick, chatMsg); } void ChatHandler::handleAnnouncement(Net::MessageIn &msg) diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index a332b04fa..5d5034938 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -89,7 +89,7 @@ void AdminHandler::localAnnounce(const std::string &text) outMsg.writeString(text, static_cast<int>(text.length())); } -void AdminHandler::hide(bool hide A_UNUSED) +void AdminHandler::hide(bool h A_UNUSED) { MessageOut outMsg(CMSG_ADMIN_HIDE); outMsg.writeInt32(0); //unused diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index 79f41dece..53fd4831f 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -50,7 +50,7 @@ class AdminHandler : public MessageHandler, public Ea::AdminHandler void localAnnounce(const std::string &text); - void hide(bool hide); + void hide(bool h); void kick(int playerId); }; diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index c087ab43d..845c30f19 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -445,7 +445,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, int msgType) Being *dstBeing; int hairStyle, hairColor; unsigned char colors[9]; - Uint8 dir; + // An update about a player, potentially including movement. int id = msg.readInt32(); @@ -469,7 +469,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, int msgType) return; } - dir = dstBeing->getDirectionDelayed(); + Uint8 dir = dstBeing->getDirectionDelayed(); if (dir) { if (dir != dstBeing->getDirection()) @@ -568,10 +568,10 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, int msgType) if (srcX != dstX || srcY != dstY) { - int dir = dstBeing->calcDirection(dstX, dstY); + int d = dstBeing->calcDirection(dstX, dstY); - if (dir && dstBeing->getDirection() != dir) - dstBeing->setDirectionDelayed(static_cast<Uint8>(dir)); + if (d && dstBeing->getDirection() != d) + dstBeing->setDirectionDelayed(static_cast<Uint8>(d)); } if (player_node->getCurrentAction() != Being::STAND) @@ -584,7 +584,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, int msgType) } else { - Uint8 dir; +// Uint8 dir; Uint16 x, y; msg.readCoordinates(x, y, dir); dstBeing->setTileCoords(x, y); diff --git a/src/party.cpp b/src/party.cpp index 9becee1cd..9da1a235d 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -119,9 +119,9 @@ void Party::removeMember(PartyMember *member) if ((*itr)->mId == member->mId && (*itr)->getName() == member->getName()) { - PartyMember *member = (*itr); + PartyMember *m = (*itr); mMembers.erase(itr); - delete member; + delete m; deleted = true; break; } diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h index a61483940..b93c11ba6 100644 --- a/src/resources/beinginfo.h +++ b/src/resources/beinginfo.h @@ -38,12 +38,12 @@ struct Attack std::string particleEffect; std::string missileParticle; - Attack(std::string action, std::string particleEffect, - std::string missileParticle) + Attack(std::string action0, std::string particleEffect0, + std::string missileParticle0) { - this->action = action; - this->particleEffect = particleEffect; - this->missileParticle = missileParticle; + action = action0; + particleEffect = particleEffect0; + missileParticle = missileParticle0; } }; |