From 4e97ec281e94c83b223879be777ec27c89aa5c9f Mon Sep 17 00:00:00 2001 From: tobspr Date: Fri, 15 May 2020 11:08:49 +0200 Subject: [PATCH] Fix bug when saving underground belts --- src/js/game/components/underground_belt.js | 2 +- src/js/savegame/serialization_data_types.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/game/components/underground_belt.js b/src/js/game/components/underground_belt.js index b9aa3922..c54c5a93 100644 --- a/src/js/game/components/underground_belt.js +++ b/src/js/game/components/underground_belt.js @@ -18,7 +18,7 @@ export class UndergroundBeltComponent extends Component { static getSchema() { return { mode: types.enum(enumUndergroundBeltMode), - pendingItems: types.array(types.pair(types.obj(gItemRegistry), types.number)), + pendingItems: types.array(types.pair(types.obj(gItemRegistry), types.ufloat)), }; } diff --git a/src/js/savegame/serialization_data_types.js b/src/js/savegame/serialization_data_types.js index 5020e09f..332dc274 100644 --- a/src/js/savegame/serialization_data_types.js +++ b/src/js/savegame/serialization_data_types.js @@ -1079,6 +1079,8 @@ export class TypePair extends BaseDataType { */ constructor(type1, type2) { super(); + assert(type1 && type1 instanceof BaseDataType, "bad first type given for pair"); + assert(type2 && type2 instanceof BaseDataType, "bad second type given for pair"); this.type1 = type1; this.type2 = type2; }