Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
swkeep committed Aug 29, 2024
1 parent 1a0c602 commit 2bc1738
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions interactionMenu/lua/client/interact.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ end

CreateThread(function()
if not waitForScaleform() then return end
-- We can bump it up to 1000 for better performance, but it looks better with 500/600 ms
-- We could bump it up to 1000 for better performance, but it looks better with 500/600 ms
local interval = Config.intervals.detection or 500
local pid = PlayerId()

Expand All @@ -256,6 +256,9 @@ CreateThread(function()
local playerPosition = GetEntityCoords(playerPed)
local model = 0
local entityType = 0
-- #TODO: Give onPosition priority?!
-- It's going to lower resource usage, BUT if we have two colliding menus, we might not be able to detect them.
-- reason: when the player is inside the `entity detector`, we won't be able to use rayCast to detect other menus.

local hitPosition, playerDistance, entity
if closestZoneId == nil and (not StateManager.get("disableRayCast") or isInVehicle ~= 1) then
Expand Down Expand Up @@ -294,10 +297,8 @@ CreateThread(function()
StateManager.reset()
end
else
-- #NOTE: We could add this to `entityZone:client:entered`, but sometimes the `exited` event takes effect after `entered`.
-- Which removes the states of the menu (if the colliding zones are really close to each other).
local model = GetEntityModel(closestEntity)
-- we're ingoring `max distance`
local model = GetEntityModel(closestEntity)
handleEntityInteraction(1.0, model, closestEntity)
end
else
Expand Down

0 comments on commit 2bc1738

Please sign in to comment.