- Fix bug of function Utils.drawPolygon: **make sure every is 'vec3'. **

This commit is contained in:
2024-12-26 17:59:24 +08:00
parent 9ce22b0c13
commit 59a450bb18
+4 -1
View File
@@ -11,10 +11,12 @@ do
for i,value in ipairs(Utils.MapMarkIDs) do
if value then
result = i
Utils.MapMarkIDs[i] = false
break
end
end
if result == nil then
if not result then
result = #Utils.MapMarkIDs + 1
Utils.MapMarkIDs[result] = false
end
@@ -321,6 +323,7 @@ do
function Utils.drawPolygon(Coalition,MarkID,vecs,Color,FillColor,LineType,ReadOnly,Text)
local s=string.format("trigger.action.markupToAll(7, %d, %d,", Coalition, MarkID)
for _,vec in pairs(vecs) do
vec = Utils.makeVec3(vec)
--s=s..string.format("%s,", UTILS._OneLineSerialize(vec))
s=s..string.format("{x=%.1f, y=%.1f, z=%.1f},", vec.x, vec.y, vec.z)
end