diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-04 19:44:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-04 19:44:48 +0300 |
commit | 46d35da5ec9fb59d2bf61fc39d36ee48b51509ba (patch) | |
tree | 994cf016f1bf6c7ac22aea6694b60b178c402d1f /src | |
parent | e70591bfb338f774570661276d02d9bc8731ae83 (diff) | |
download | manaplus-46d35da5ec9fb59d2bf61fc39d36ee48b51509ba.tar.gz manaplus-46d35da5ec9fb59d2bf61fc39d36ee48b51509ba.tar.bz2 manaplus-46d35da5ec9fb59d2bf61fc39d36ee48b51509ba.tar.xz manaplus-46d35da5ec9fb59d2bf61fc39d36ee48b51509ba.zip |
Replcae find to compare if need.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/popupmenu.cpp | 12 | ||||
-rw-r--r-- | src/sound.cpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 8e668c1ed..6c43fdfa1 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -1127,7 +1127,7 @@ void PopupMenu::handleLink(const std::string &link, showChangePos(getX(), getY()); return; } - else if (!link.find("guild-pos-")) + else if (!link.compare(0, 10, "guild-pos-")) { if (player_node) { @@ -1140,7 +1140,7 @@ void PopupMenu::handleLink(const std::string &link, } } } - else if (!link.find("player_")) + else if (!link.compare(0, 7, "player_")) { mBeingId = atoi(link.substr(7).c_str()); Being *being = actorSpriteManager->findBeing(mBeingId); @@ -1150,22 +1150,22 @@ void PopupMenu::handleLink(const std::string &link, return; } } - else if (!link.find("hide button_")) + else if (!link.compare(0, 12, "hide button_")) { if (windowMenu) windowMenu->showButton(link.substr(12), false); } - else if (!link.find("show button_")) + else if (!link.compare(0, 12, "show button_")) { if (windowMenu) windowMenu->showButton(link.substr(12), true); } - else if (!link.find("hide bar_")) + else if (!link.compare(0, 9, "hide bar_")) { if (miniStatusWindow) miniStatusWindow->showBar(link.substr(9), false); } - else if (!link.find("show bar_")) + else if (!link.compare(0, 9, "show bar_")) { if (miniStatusWindow) miniStatusWindow->showBar(link.substr(9), true); diff --git a/src/sound.cpp b/src/sound.cpp index e3b1a9bcc..d490898c8 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -269,7 +269,7 @@ void Sound::playSfx(const std::string &path, int x, int y) return; std::string tmpPath; - if (!path.find("sfx/")) + if (!path.compare(0, 4, "sfx/")) tmpPath = path; else tmpPath = paths.getValue("sfx", "sfx/") + path; |