aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
authorAnubisss <none@none>2009-07-05 01:19:49 +0200
committerAnubisss <none@none>2009-07-05 01:19:49 +0200
commitbf697be6f30ef196f40fc053212ba9d86e8f969a (patch)
tree634756b4fa56c5ef012221b42015174366195b25 /src/game/Level2.cpp
parentd78c917effceb3a5624ce5410a6b396511efb444 (diff)
*Change uint32 counter to bool found in lookup commands.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r--src/game/Level2.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 73bfb7bd96b..3bfdcbd1a97 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -914,7 +914,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args)
// converting string that we try to find to lower case
wstrToLower (wnamepart);
- uint32 counter = 0; // Counter for figure out that we found smth.
+ bool found = false;
for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
{
@@ -979,12 +979,14 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args)
ss << GetTrinityString(LANG_FACTION_NOREPUTATION);
SendSysMessage(ss.str().c_str());
- counter++;
+
+ if(!found)
+ found = true;
}
}
}
- if (counter == 0) // if counter == 0 then we found nth
+ if (!found)
SendSysMessage(LANG_COMMAND_FACTION_NOTFOUND);
return true;
}
@@ -3677,7 +3679,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
wstrToLower(wnamepart);
- uint32 counter = 0;
+ bool found = false;
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
@@ -3699,11 +3701,12 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
else
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active );
- ++counter;
+ if(!found)
+ found = true;
}
}
- if (counter==0)
+ if (!found)
SendSysMessage(LANG_NOEVENTFOUND);
return true;