Skip to content

Commit 24679be

Browse files
authored
fix: Allow entity references for clients with L and N format specifiers (#2244)
1 parent cb0f8f0 commit 24679be

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

bridge/include/CoreProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class CoreProvider
106106
virtual bool IsMapLoading() = 0;
107107
virtual bool IsMapRunning() = 0;
108108
virtual int MaxClients() = 0;
109-
virtual bool DescribePlayer(int index, const char **namep, const char **authp, int *useridp) = 0;
109+
virtual bool DescribePlayer(int entRef, const char **namep, const char **authp, int *useridp) = 0;
110110
virtual void LogToGame(const char *message) = 0;
111111
virtual void ConPrint(const char *message) = 0;
112112
virtual void ConsolePrint(const char *fmt, ...) = 0;

core/logic_bridge.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,9 @@ int CoreProviderImpl::MaxClients()
574574
return g_Players.MaxClients();
575575
}
576576

577-
bool CoreProviderImpl::DescribePlayer(int index, const char **namep, const char **authp, int *useridp)
577+
bool CoreProviderImpl::DescribePlayer(int entRef, const char **namep, const char **authp, int *useridp)
578578
{
579+
int index = g_HL2.ReferenceToIndex(entRef);
579580
CPlayer *player = g_Players.GetPlayerByIndex(index);
580581
if (!player || !player->IsConnected())
581582
return false;

core/provider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CoreProviderImpl : public CoreProvider
5656
bool IsMapLoading() override;
5757
bool IsMapRunning() override;
5858
int MaxClients() override;
59-
bool DescribePlayer(int index, const char **namep, const char **authp, int *useridp) override;
59+
bool DescribePlayer(int entRef, const char **namep, const char **authp, int *useridp) override;
6060
void LogToGame(const char *message) override;
6161
void ConPrint(const char *message) override;
6262
void ConsolePrint(const char *fmt, ...) override;

0 commit comments

Comments
 (0)