From 397759bb447a259c0d0e44e7a9509765e1ffdf09 Mon Sep 17 00:00:00 2001 From: Lucas GAUTHERON Date: Fri, 11 Oct 2013 16:54:35 +0000 Subject: [PATCH] /whois -1 fix git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7589 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 4df0ed7a..7e91d63f 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -1583,19 +1583,15 @@ void cleanplayervotes(playerent *p) void whois(int *cn) { - playerent *p = getclient(*cn); - if(!p) + loopv(players) if(players[i] && players[i]->type == ENT_PLAYER && (*cn == -1 || players[i]->clientnum == *cn)) { - conoutf(_("invalid player name")); - return; + playerent *p = players[i]; + uint2ip(p->address, ip); + if(m_teammode) conoutf(_("%c0INFO: %c5%s has %d teamkills."), CC, CC, p->name, p->tks); + if(ip[3] != 0 || player1->clientrole==CR_ADMIN) + conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.%d", *cn, colorname(p), ip[0], ip[1], ip[2], ip[3]); // full IP + else conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.x", *cn, colorname(p), ip[0], ip[1], ip[2]); // censored IP } - - uint2ip(p->address, ip); - - if(m_teammode) conoutf(_("%c0INFO: %c5%s has %d teamkills."), CC, CC, p->name, p->tks); - if(ip[3] != 0 || player1->clientrole==CR_ADMIN) - conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.%d", *cn, colorname(p), ip[0], ip[1], ip[2], ip[3]); // full IP - else conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.x", *cn, colorname(p), ip[0], ip[1], ip[2]); // censored IP } COMMAND(whois, "i");