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:
parent
c94e1f7a97
commit
9f9b92ec43
@ -727,12 +727,14 @@ reswitch:
|
|||||||
CHECK_ARGS(0);
|
CHECK_ARGS(0);
|
||||||
cell_t *value;
|
cell_t *value;
|
||||||
pCtx->LocalToPhysAddr(params[arg], &value);
|
pCtx->LocalToPhysAddr(params[arg], &value);
|
||||||
|
char buffer[255];
|
||||||
|
if (*value)
|
||||||
|
{
|
||||||
CPlayer *player = g_Players.GetPlayerByIndex(*value);
|
CPlayer *player = g_Players.GetPlayerByIndex(*value);
|
||||||
if (!player || !player->IsConnected())
|
if (!player || !player->IsConnected())
|
||||||
{
|
{
|
||||||
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
|
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
|
||||||
}
|
}
|
||||||
char buffer[255];
|
|
||||||
const char *auth = player->GetAuthString();
|
const char *auth = player->GetAuthString();
|
||||||
if (!auth || auth[0] == '\0')
|
if (!auth || auth[0] == '\0')
|
||||||
{
|
{
|
||||||
@ -745,6 +747,11 @@ reswitch:
|
|||||||
player->GetName(),
|
player->GetName(),
|
||||||
userid,
|
userid,
|
||||||
auth);
|
auth);
|
||||||
|
} else {
|
||||||
|
UTIL_Format(buffer,
|
||||||
|
sizeof(buffer),
|
||||||
|
"Console<0><Console><Console>");
|
||||||
|
}
|
||||||
AddString(&buf_p, llen, buffer, width, prec);
|
AddString(&buf_p, llen, buffer, width, prec);
|
||||||
arg++;
|
arg++;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user