From 02d296a4cb2123ce685250fe04241813bf138345 Mon Sep 17 00:00:00 2001 From: drakewill-CRL <46307022+drakewill-CRL@users.noreply.github.com> Date: Sun, 20 Dec 2020 22:34:39 -0500 Subject: [PATCH] Roslyn games no longer wipe their save data on any error. --- SDK/Engine/Chips/Game/GameChipLite.cs | 1 - SDK/Runner/DesktopRunner.cs | 3 ++- SDK/Runner/Parsers/SpriteImageParser.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SDK/Engine/Chips/Game/GameChipLite.cs b/SDK/Engine/Chips/Game/GameChipLite.cs index 2e163708..23162eee 100755 --- a/SDK/Engine/Chips/Game/GameChipLite.cs +++ b/SDK/Engine/Chips/Game/GameChipLite.cs @@ -66,7 +66,6 @@ public enum Buttons /// public class GameChipLite : AbstractChip, IUpdate, IDraw { - public int fps; // protected int[] tmpFontData = new int[0]; protected int[] tmpSpriteData = new int[0]; diff --git a/SDK/Runner/DesktopRunner.cs b/SDK/Runner/DesktopRunner.cs index 3c1a1a55..e229c9a2 100755 --- a/SDK/Runner/DesktopRunner.cs +++ b/SDK/Runner/DesktopRunner.cs @@ -1494,7 +1494,8 @@ public void SaveGameData(string path, IEngine engine, SaveFlags saveFlags, bool // Export the current game // TODO exporter needs a callback when its completed - ExportService.ExportGame(path, engine, saveFlags, useSteps); + if (mode != RunnerMode.Error) //Was causing Roslyn games to wipe save data on any error. + ExportService.ExportGame(path, engine, saveFlags, useSteps); } protected override void OnExiting(object sender, EventArgs args) diff --git a/SDK/Runner/Parsers/SpriteImageParser.cs b/SDK/Runner/Parsers/SpriteImageParser.cs index efcc1d27..2b4edf64 100755 --- a/SDK/Runner/Parsers/SpriteImageParser.cs +++ b/SDK/Runner/Parsers/SpriteImageParser.cs @@ -105,7 +105,7 @@ public virtual void PrepareSprites() var cols = MathUtil.FloorToInt(spriteChip.textureWidth / spriteWidth); var rows = MathUtil.FloorToInt(spriteChip.textureHeight / spriteHeight); - maxSprites = cols * rows; + maxSprites = cols * rows; // // Keep track of number of sprites added spritesAdded = 0;