fix crash when spaces are in puzzle pack name

This commit is contained in:
2022-08-19 21:18:28 +00:00
parent 6533fa77d2
commit b5284f99ae
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package;
using StringTools;
import flash.display.BitmapData;
import haxe.io.Path;
import flixel.FlxG;

View File

@@ -249,9 +249,14 @@
FlxColor.GRAY
])
(function nameForSave [:String name]
(doFor forbiddenChar (.split #"~%&\;:"',<>?# "# "")
(set name (name.replace forbiddenChar "")))
name)
(method makeRewardSprites [m p currentRewardFile]
(set save (new FlxSave))
(save.bind currentRewardFile.path)
(assert (save.bind (nameForSave currentRewardFile.path)) "failed to bind save data")
(unless save.data.storedPositions
(set save.data.storedPositions (new Map<Int,FlxPoint>)))
(unless save.data.storedAngles