From 2bc173844ac443cb824b8b8ea69e2e3346730bcd Mon Sep 17 00:00:00 2001 From: swkeep Date: Thu, 29 Aug 2024 09:20:10 +0200 Subject: [PATCH] chore: comments --- interactionMenu/lua/client/interact.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/interactionMenu/lua/client/interact.lua b/interactionMenu/lua/client/interact.lua index b6077a6..72086bd 100644 --- a/interactionMenu/lua/client/interact.lua +++ b/interactionMenu/lua/client/interact.lua @@ -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() @@ -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 @@ -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