From c4efc223ededfe13d47d5364e0122edab692b293 Mon Sep 17 00:00:00 2001 From: quantumstate Date: Sat, 5 May 2012 21:21:36 +0000 Subject: [PATCH] Don't serialize the technology modifications cache. Fixes #1384. This was SVN commit r11761. --- .../simulation/components/TechnologyManager.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/binaries/data/mods/public/simulation/components/TechnologyManager.js b/binaries/data/mods/public/simulation/components/TechnologyManager.js index 72782bdc97..89f0ee296b 100644 --- a/binaries/data/mods/public/simulation/components/TechnologyManager.js +++ b/binaries/data/mods/public/simulation/components/TechnologyManager.js @@ -2,6 +2,21 @@ function TechnologyManager() {} TechnologyManager.prototype.Schema = ""; + +TechnologyManager.prototype.Serialize = function() +{ + // The modifications cache will be affected by property reads from the GUI and other places so we shouldn't + // serialize it. + + var ret = {}; + for (i in this) + { + if (this.hasOwnProperty(i)) + ret[i] = this[i]; + } + ret.modificationCache = {}; + return ret; +}; TechnologyManager.prototype.Init = function () {