diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 0a788a90f..1d723d086 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -961,10 +961,7 @@ class Save */ static function loadFromSlot(slot:Int):Save { - trace("[SAVE] Loading save from slot " + slot + "..."); - - // Prevent crashes if the save data is corrupted. - SerializerUtil.initSerializer(); + trace('[SAVE] Loading save from slot $slot...'); FlxG.save.bind('$SAVE_NAME${slot}', SAVE_PATH); diff --git a/source/funkin/util/SerializerUtil.hx b/source/funkin/util/SerializerUtil.hx index fa602cc73..c87d3f6c0 100644 --- a/source/funkin/util/SerializerUtil.hx +++ b/source/funkin/util/SerializerUtil.hx @@ -63,31 +63,6 @@ class SerializerUtil } } - public static function initSerializer():Void - { - haxe.Unserializer.DEFAULT_RESOLVER = new FunkinTypeResolver(); - } - - /** - * Serialize a Haxe object using the built-in Serializer. - * @param input The object to serialize - * @return The serialized object as a string - */ - public static function fromHaxeObject(input:Dynamic):String - { - return haxe.Serializer.run(input); - } - - /** - * Convert a serialized Haxe object back into a Haxe object. - * @param input The serialized object as a string - * @return The deserialized object - */ - public static function toHaxeObject(input:String):Dynamic - { - return haxe.Unserializer.run(input); - } - /** * Customize how certain types are serialized when converting to JSON. */ @@ -115,26 +90,3 @@ class SerializerUtil return result; } } - -class FunkinTypeResolver -{ - public function new() - { - // Blank constructor. - } - - public function resolveClass(name:String):Class - { - if (name == 'Dynamic') - { - FlxG.log.warn('Found invalid class type in save data, indicates partial save corruption.'); - return null; - } - return Type.resolveClass(name); - }; - - public function resolveEnum(name:String):Enum - { - return Type.resolveEnum(name); - }; -}