fix: Allow entity references for clients with L and N format specifiers (#2244)

This commit is contained in:
Nicholas Hastings 2025-01-15 19:57:46 -05:00 committed by GitHub
parent cb0f8f0eaa
commit 24679be81a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View File

@ -106,7 +106,7 @@ public:
virtual bool IsMapLoading() = 0;
virtual bool IsMapRunning() = 0;
virtual int MaxClients() = 0;
virtual bool DescribePlayer(int index, const char **namep, const char **authp, int *useridp) = 0;
virtual bool DescribePlayer(int entRef, const char **namep, const char **authp, int *useridp) = 0;
virtual void LogToGame(const char *message) = 0;
virtual void ConPrint(const char *message) = 0;
virtual void ConsolePrint(const char *fmt, ...) = 0;

View File

@ -574,8 +574,9 @@ int CoreProviderImpl::MaxClients()
return g_Players.MaxClients();
}
bool CoreProviderImpl::DescribePlayer(int index, const char **namep, const char **authp, int *useridp)
bool CoreProviderImpl::DescribePlayer(int entRef, const char **namep, const char **authp, int *useridp)
{
int index = g_HL2.ReferenceToIndex(entRef);
CPlayer *player = g_Players.GetPlayerByIndex(index);
if (!player || !player->IsConnected())
return false;

View File

@ -56,7 +56,7 @@ public:
bool IsMapLoading() override;
bool IsMapRunning() override;
int MaxClients() override;
bool DescribePlayer(int index, const char **namep, const char **authp, int *useridp) override;
bool DescribePlayer(int entRef, const char **namep, const char **authp, int *useridp) override;
void LogToGame(const char *message) override;
void ConPrint(const char *message) override;
void ConsolePrint(const char *fmt, ...) override;