From 3897b41d45e6d09a5bff78e2fe48e25a06fa8d31 Mon Sep 17 00:00:00 2001 From: Daan Breur Date: Sat, 27 Nov 2021 15:12:53 +0100 Subject: [PATCH] Add variables for shape-percentages - Add `fullShapePercentage` and `wierdShapePercentage` to `BaseMap` - added migration for `fullShapePercentage` and `wierdShapePercentage` in `savegame/1010.js` Signed-off-by: Daan Breur --- src/js/game/map.js | 4 ++++ src/js/savegame/schemas/1010.js | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/js/game/map.js b/src/js/game/map.js index 8edff48b..c59341b9 100644 --- a/src/js/game/map.js +++ b/src/js/game/map.js @@ -16,6 +16,8 @@ export class BaseMap extends BasicSerializableObject { return { seed: types.uint, allowNonPrimaryColors: types.bool, + fullShapePercentage: types.uint, + wierdShapePercentage: types.uint, }; } @@ -29,6 +31,8 @@ export class BaseMap extends BasicSerializableObject { this.seed = 0; this.allowNonPrimaryColors = false; + this.fullShapePercentage = 0; + this.wierdShapePercentage = 0; /** * Mapping of 'X|Y' to chunk diff --git a/src/js/savegame/schemas/1010.js b/src/js/savegame/schemas/1010.js index e1917581..56cca297 100644 --- a/src/js/savegame/schemas/1010.js +++ b/src/js/savegame/schemas/1010.js @@ -26,5 +26,13 @@ export class SavegameInterface_V1010 extends SavegameInterface_V1009 { if (!dump.map.hasOwnProperty("allowNonPrimaryColors")) { dump.map.allowNonPrimaryColors = false; } + + if (!dump.map.hasOwnProperty("fullShapePercentage")) { + dump.map.fullShapePercentage = 0; + } + + if (!dump.map.hasOwnProperty("wierdShapePercentage")) { + dump.map.wierdShapePercentage = 0; + } } }