fixed a bug where the console was not a valid loggable player from %L

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40912
This commit is contained in:
David Anderson 2007-06-07 05:53:32 +00:00
parent c94e1f7a97
commit 9f9b92ec43

View File

@ -727,12 +727,14 @@ reswitch:
CHECK_ARGS(0);
cell_t *value;
pCtx->LocalToPhysAddr(params[arg], &value);
char buffer[255];
if (*value)
{
CPlayer *player = g_Players.GetPlayerByIndex(*value);
if (!player || !player->IsConnected())
{
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
}
char buffer[255];
const char *auth = player->GetAuthString();
if (!auth || auth[0] == '\0')
{
@ -745,6 +747,11 @@ reswitch:
player->GetName(),
userid,
auth);
} else {
UTIL_Format(buffer,
sizeof(buffer),
"Console<0><Console><Console>");
}
AddString(&buf_p, llen, buffer, width, prec);
arg++;
break;