aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-01-12 21:02:19 +0100
committerShauren <shauren.trinity@gmail.com>2012-01-12 21:02:19 +0100
commitd3f66dfe6d270ccbe1f6197a2f2e52d541926ca0 (patch)
treeeea2c0805507623fd23490294fa6ec9648f5b90a /src
parent7684340fe2259a80e3de4ccb5aaa183bb07f8aaa (diff)
Core/Commands: Correction to 57490ead833074bd83ae38be8ee50e9f9813759a, when ip parameter is supplied it should be used over selection
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Chat/Commands/Level2.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp
index 2f04ebcf6bc..31942d9e2fa 100755
--- a/src/server/game/Chat/Commands/Level2.cpp
+++ b/src/server/game/Chat/Commands/Level2.cpp
@@ -712,19 +712,20 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
char* limit_str;
Player *chr = getSelectedPlayer();
- if (chr == NULL)
+ if (!*args)
{
- if (!*args)
+ // NULL only if used from console
+ if (!chr || chr == GetSession()->GetPlayer())
return false;
- ip = strtok ((char*)args, " ");
- limit_str = strtok (NULL, " ");
- limit = limit_str ? atoi (limit_str) : -1;
+ ip = chr->GetSession()->GetRemoteAddress();
+ limit = -1;
}
else
{
- ip = chr->GetSession()->GetRemoteAddress();
- limit = -1;
+ ip = strtok ((char*)args, " ");
+ limit_str = strtok (NULL, " ");
+ limit = limit_str ? atoi (limit_str) : -1;
}
LoginDatabase.EscapeString(ip);