- Fix bug of function Utils.drawPolygon: **make sure every is 'vec3'. **
This commit is contained in:
+5
-2
@@ -11,10 +11,12 @@ do
|
|||||||
for i,value in ipairs(Utils.MapMarkIDs) do
|
for i,value in ipairs(Utils.MapMarkIDs) do
|
||||||
if value then
|
if value then
|
||||||
result = i
|
result = i
|
||||||
|
Utils.MapMarkIDs[i] = false
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if result == nil then
|
if not result then
|
||||||
result = #Utils.MapMarkIDs + 1
|
result = #Utils.MapMarkIDs + 1
|
||||||
Utils.MapMarkIDs[result] = false
|
Utils.MapMarkIDs[result] = false
|
||||||
end
|
end
|
||||||
@@ -320,7 +322,8 @@ do
|
|||||||
|
|
||||||
function Utils.drawPolygon(Coalition,MarkID,vecs,Color,FillColor,LineType,ReadOnly,Text)
|
function Utils.drawPolygon(Coalition,MarkID,vecs,Color,FillColor,LineType,ReadOnly,Text)
|
||||||
local s=string.format("trigger.action.markupToAll(7, %d, %d,", Coalition, MarkID)
|
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("%s,", UTILS._OneLineSerialize(vec))
|
||||||
s=s..string.format("{x=%.1f, y=%.1f, z=%.1f},", vec.x, vec.y, vec.z)
|
s=s..string.format("{x=%.1f, y=%.1f, z=%.1f},", vec.x, vec.y, vec.z)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user