Open CX97x opened 9 months ago
anyone working on this issue? If not I want to
Getting the same problem with integers using inst_to_dict(). They appear much bigger then visually displayed. Parsing them to int() creates a big number: int(3) -> 4618441417868443648 Comparing them to other numbers can lead to wrong results: 3 < 99 -> false
With dict_to_inst, I got an issue similar to (2) where I changed the type in my script but loaded an older JSON. Instead of casting it to the type or warning me of the incompatible type, it stored the outdated type.
Tested versions
4.2.1.stable and 4.2.2.rc
System information
Windows 11
Issue description
inst_to_dict()
can't handle types like Color when the dictionary is converted to a String with JSON later, it handles them as String (e. g."(1, 1, 0, 1)"
)dict_to_inst()
can assingn other types to a typed variable (e. g. the String from above tovar example :Color
)dict_to_inst()
can't handle integers and arrays with integers correctly which leads sometimes to problems when comparing two numbers (e. g.a == b
returns false if a and b are both 1), because they are parsed as floats laterinst_to_dict()
in plugins under some circumstancesSteps to reproduce
reproduce 1., 2. and 3: Convert an instance to a dictionary, than to a JSON string and then back to a dictionary and an instance reproduce 4.: try
inst_to_dict()
on theobject
of a EditorInspectorPluginMinimal reproduction project (MRP)
inst_to_dict() MRP.zip
1., 2. and 3..: run the scene WrongTypes.tscn 3.: I wasn't able to reproduce the comparison error 4.: Open the Resource ClickButtonToCrashTheEditor.tscn and click the crash button