From 4531b5993cce40add0db94e6b11d282327e9b4f9 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Tue, 28 Mar 2023 03:02:55 +0300 Subject: [PATCH] Fix pxo loading --- src/Autoload/Global.gd | 2 +- src/Classes/Layer3D.gd | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 7acfaae86..fa5517a3b 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -596,5 +596,5 @@ func convert_dictionary_values(dict: Dictionary) -> void: dict[key] = str2var("Color(" + dict[key] + ")") elif "v2" in key: # Convert a String to a Vector2 dict[key] = str2var("Vector2" + dict[key]) - elif "size" in key: # Convert a String to a Vector3 + elif "size" in key or "center_offset" in key: # Convert a String to a Vector3 dict[key] = str2var("Vector3" + dict[key]) diff --git a/src/Classes/Layer3D.gd b/src/Classes/Layer3D.gd index f84f5beb0..de2df4d30 100644 --- a/src/Classes/Layer3D.gd +++ b/src/Classes/Layer3D.gd @@ -120,7 +120,11 @@ func serialize() -> Dictionary: func deserialize(dict: Dictionary) -> void: .deserialize(dict) properties = dict["properties"] - objects = dict["objects"] + var objects_copy = dict["objects"] + for object in objects_copy: + if typeof(object) != TYPE_STRING: + return + objects[int(object)] = int(objects_copy[object]) # new_cels_linked = dict.new_cels_linked current_object_id = objects.size() Global.convert_dictionary_values(properties)