diff --git a/bridge/include/CoreProvider.h b/bridge/include/CoreProvider.h index 770d2f5928..2bf95323d8 100644 --- a/bridge/include/CoreProvider.h +++ b/bridge/include/CoreProvider.h @@ -106,7 +106,7 @@ class CoreProvider 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; diff --git a/core/logic_bridge.cpp b/core/logic_bridge.cpp index 4cc1128a78..57e4f341ee 100644 --- a/core/logic_bridge.cpp +++ b/core/logic_bridge.cpp @@ -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; diff --git a/core/provider.h b/core/provider.h index 41ae71f20c..a1ad393fed 100644 --- a/core/provider.h +++ b/core/provider.h @@ -56,7 +56,7 @@ class CoreProviderImpl : public CoreProvider 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;