mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
perf(zones): debug
Iterate polygon userdata directly, instead of creating a new table each frame.
This commit is contained in:
@@ -6,16 +6,18 @@ local function removeZone(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function debug(self)
|
local function debug(self)
|
||||||
local points = self.polygon()
|
local polygon = self.polygon
|
||||||
for i = 1, #points do
|
local polyCount = #self.polygon
|
||||||
if i == #points then
|
|
||||||
DrawPoly(points[i], points[1], self.centroid, 255, 0, 0, 50)
|
for i = 1, polyCount do
|
||||||
DrawPoly(points[1], points[i], self.centroid, 255, 0, 0, 50)
|
if i == polyCount then
|
||||||
else
|
DrawPoly(polygon[i], polygon[1], self.centroid, 255, 0, 0, 50)
|
||||||
DrawPoly(points[i], points[i + 1], self.centroid, 255, 0, 0, 50)
|
DrawPoly(polygon[1], polygon[i], self.centroid, 255, 0, 0, 50)
|
||||||
DrawPoly(points[i + 1], points[i], self.centroid, 255, 0, 0, 50)
|
else
|
||||||
end
|
DrawPoly(polygon[i], polygon[i + 1], self.centroid, 255, 0, 0, 50)
|
||||||
end
|
DrawPoly(polygon[i + 1], polygon[i], self.centroid, 255, 0, 0, 50)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local inside = {}
|
local inside = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user