Skip to content

Commit

Permalink
fix: Allow entity references for clients with L and N format specifie…
Browse files Browse the repository at this point in the history
…rs (#2244)
  • Loading branch information
psychonic authored Jan 16, 2025
1 parent cb0f8f0 commit 24679be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bridge/include/CoreProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion core/logic_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 24679be

Please sign in to comment.