mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
fix(zones): update zone distance when checking contains
todo: consume caffeine
This commit is contained in:
@@ -262,16 +262,18 @@ local function debugSphere(self)
|
|||||||
self.debugColour.g, self.debugColour.b, self.debugColour.a, false, false, 0, false, false, false, false)
|
self.debugColour.g, self.debugColour.b, self.debugColour.a, false, false, 0, false, false, false, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function contains(self, coords)
|
local function contains(self, coords, updateDistance)
|
||||||
|
if updateDistance then self.distance = #(self.coords - coords) end
|
||||||
|
|
||||||
return glm_polygon_contains(self.polygon, coords, self.thickness / 4)
|
return glm_polygon_contains(self.polygon, coords, self.thickness / 4)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function insideSphere(self, coords, updateDistance)
|
local function insideSphere(self, coords, updateDistance)
|
||||||
local distance = #(self.coords - coords) < self.radius
|
local distance = #(self.coords - coords)
|
||||||
|
|
||||||
if updateDistance then self.distance = distance end
|
if updateDistance then self.distance = distance end
|
||||||
|
|
||||||
return distance
|
return distance < self.radius
|
||||||
end
|
end
|
||||||
|
|
||||||
local function convertToVector(coords)
|
local function convertToVector(coords)
|
||||||
|
|||||||
Reference in New Issue
Block a user