From 59a450bb18738350930936b80c716d0a43ae9236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=BC=E5=A4=9C=E7=8B=8E=E6=98=B5?= <1046295287@qq.com> Date: Thu, 26 Dec 2024 17:59:24 +0800 Subject: [PATCH] - Fix bug of function Utils.drawPolygon: **make sure every is 'vec3'. ** --- Scripts/Utils.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Scripts/Utils.lua b/Scripts/Utils.lua index 15ff9af..0ecdf3e 100644 --- a/Scripts/Utils.lua +++ b/Scripts/Utils.lua @@ -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 @@ -320,7 +322,8 @@ 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 + 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