Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading