Skip to content

Fixing User Interaction Distance Gard Sync#525

Open
Lucasgood5 wants to merge 3 commits intoNebulousCloud:masterfrom
Lucasgood5:patch-5
Open

Fixing User Interaction Distance Gard Sync#525
Lucasgood5 wants to merge 3 commits intoNebulousCloud:masterfrom
Lucasgood5:patch-5

Conversation

@Lucasgood5
Copy link
Copy Markdown
Contributor

This commit fix desync from the check between Serverside CanPlayerInteractEntity and ClienSide ShowEntityMenu.

The issue was that client side, we were checking distance by using a trace of 96u. Trace take origin from eye and stop at collision box. Serverside, the anti cheat check was comparing distance of entity. But this was starting by foot up to entity center. Meaning that if the entity was above, or with large entity, the client would think it is in range but the server said no.

This commit make both check use the same methods (trace). Fixing the issue at the origin of #483 without adding any configuration requirement.

This commit doesn't edit but is also related to

if (!ix.menu.IsOpen()) then
local data = {}
data.start = client:GetShootPos()
data.endpos = data.start + client:GetAimVector() * 96
data.filter = client
local entity = util.TraceLine(data).Entity
if (IsValid(entity) and isfunction(entity.GetEntityMenu)) then
hook.Run("ShowEntityMenu", entity)
end
end

This commit fix desync from the check between Serverside CanPlayerInteractEntity and ClienSide ShowEntityMenu.

The issue was that client side, we were checking distance by using a trace of 96u. Trace take origin from eye and stop at collision box. Serverside, the anti cheat check was comparing distance of entity. But this was starting by foot up to entity center.
Meaning that if the entity was above, or with large entity, the client would think it is in range but the server said no.

This commit make both check use the same methods (trace).
Fixing the issue at the origin of NebulousCloud#483 without adding any configuration requirement.

This commit doesn't edit but is also related to https://github.com/NebulousCloud/helix/blob/e35c691d630eda7693aef17d92015586294f95e6/gamemode/core/hooks/cl_hooks.lua#L737-L748
Copilot AI review requested due to automatic review settings February 28, 2026 11:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a desync between client-side entity menu range checks and the server-side CanPlayerInteractEntity validation by switching the server to use the same trace-based approach as the client.

Changes:

  • Replaced server-side distance-to-entity-center validation with an aim trace (96u) starting from GetShootPos().
  • Server now allows interaction only when the selected entity matches the currently traced entity, aligning with client menu opening logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

just a little cleanner i guess

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 28, 2026 11:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants