Core/Commands: Correction to 57490ead83, when ip parameter is supplied it should be used over selection
This commit is contained in:
@@ -712,19 +712,20 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
|
|||||||
char* limit_str;
|
char* limit_str;
|
||||||
|
|
||||||
Player *chr = getSelectedPlayer();
|
Player *chr = getSelectedPlayer();
|
||||||
if (chr == NULL)
|
|
||||||
{
|
|
||||||
if (!*args)
|
if (!*args)
|
||||||
|
{
|
||||||
|
// NULL only if used from console
|
||||||
|
if (!chr || chr == GetSession()->GetPlayer())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ip = strtok ((char*)args, " ");
|
ip = chr->GetSession()->GetRemoteAddress();
|
||||||
limit_str = strtok (NULL, " ");
|
limit = -1;
|
||||||
limit = limit_str ? atoi (limit_str) : -1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ip = chr->GetSession()->GetRemoteAddress();
|
ip = strtok ((char*)args, " ");
|
||||||
limit = -1;
|
limit_str = strtok (NULL, " ");
|
||||||
|
limit = limit_str ? atoi (limit_str) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginDatabase.EscapeString(ip);
|
LoginDatabase.EscapeString(ip);
|
||||||
|
|||||||
Reference in New Issue
Block a user