Fixed polygon deserialization (#294)

This commit is contained in:
RodZill4 2021-02-25 19:23:13 +01:00
parent 3a7a6bd6bc
commit d507107577
1 changed files with 2 additions and 2 deletions

View File

@ -67,10 +67,10 @@ func deserialize(v) -> void:
clear()
if typeof(v) == TYPE_DICTIONARY and v.has("type") and v.type == "Polygon":
for p in v.points:
add_point(p.x, p.y)
points.push_back(Vector2(p.x, p.y))
elif typeof(v) == TYPE_OBJECT and v.get_script() == get_script():
clear()
for p in v.points:
add_point(p.x, p.y)
points.push_back(Vector2(p.x, p.y))
else:
print("Cannot deserialize polygon")