mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
fix(zones): zone.inside should not depend on zone.onEnter
This commit is contained in:
@@ -232,17 +232,21 @@ CreateThread(function()
|
|||||||
local contains = zone:contains(coords)
|
local contains = zone:contains(coords)
|
||||||
|
|
||||||
if contains then
|
if contains then
|
||||||
|
if zone.onEnter and not zone.insideZone then
|
||||||
|
zone:onEnter()
|
||||||
|
end
|
||||||
|
|
||||||
if zone.inside then
|
if zone.inside then
|
||||||
insideCount += 1
|
insideCount += 1
|
||||||
inside[insideCount] = zone
|
inside[insideCount] = zone
|
||||||
end
|
end
|
||||||
|
|
||||||
if zone.onEnter and not zone.insideZone then
|
if not zone.insideZone then
|
||||||
zone.insideZone = true
|
zone.insideZone = true
|
||||||
zone:onEnter()
|
|
||||||
end
|
end
|
||||||
elseif zone.insideZone then
|
elseif zone.insideZone then
|
||||||
zone.insideZone = nil
|
zone.insideZone = false
|
||||||
|
|
||||||
if zone.onExit then
|
if zone.onExit then
|
||||||
zone:onExit()
|
zone:onExit()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user