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,24 +727,31 @@ reswitch:
|
|||||||
CHECK_ARGS(0);
|
CHECK_ARGS(0);
|
||||||
cell_t *value;
|
cell_t *value;
|
||||||
pCtx->LocalToPhysAddr(params[arg], &value);
|
pCtx->LocalToPhysAddr(params[arg], &value);
|
||||||
CPlayer *player = g_Players.GetPlayerByIndex(*value);
|
|
||||||
if (!player || !player->IsConnected())
|
|
||||||
{
|
|
||||||
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
|
|
||||||
}
|
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
const char *auth = player->GetAuthString();
|
if (*value)
|
||||||
if (!auth || auth[0] == '\0')
|
|
||||||
{
|
{
|
||||||
auth = "STEAM_ID_PENDING";
|
CPlayer *player = g_Players.GetPlayerByIndex(*value);
|
||||||
|
if (!player || !player->IsConnected())
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Client index %d is invalid", *value);
|
||||||
|
}
|
||||||
|
const char *auth = player->GetAuthString();
|
||||||
|
if (!auth || auth[0] == '\0')
|
||||||
|
{
|
||||||
|
auth = "STEAM_ID_PENDING";
|
||||||
|
}
|
||||||
|
int userid = engine->GetPlayerUserId(player->GetEdict());
|
||||||
|
UTIL_Format(buffer,
|
||||||
|
sizeof(buffer),
|
||||||
|
"%s<%d><%s><>",
|
||||||
|
player->GetName(),
|
||||||
|
userid,
|
||||||
|
auth);
|
||||||
|
} else {
|
||||||
|
UTIL_Format(buffer,
|
||||||
|
sizeof(buffer),
|
||||||
|
"Console<0><Console><Console>");
|
||||||
}
|
}
|
||||||
int userid = engine->GetPlayerUserId(player->GetEdict());
|
|
||||||
UTIL_Format(buffer,
|
|
||||||
sizeof(buffer),
|
|
||||||
"%s<%d><%s><>",
|
|
||||||
player->GetName(),
|
|
||||||
userid,
|
|
||||||
auth);
|
|
||||||
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