Compatibility with content mods (#350)

This commit is contained in:
staticvariablejames
2020-11-26 11:01:06 -06:00
committed by GitHub
parent 3d965943c0
commit 66ac922ae2
4 changed files with 82 additions and 48 deletions

View File

@@ -168,6 +168,8 @@ CM.Sim.CopyData = function() {
var you = CM.Sim.Objects[i];
if (you == undefined) {
CM.Sim.InitData();
you = CM.Sim.Objects[i]; // Not undefined anymore
CM.Disp.CreateBotBarBuildingColumn(i); // New building! Add it to the bottom bar
}
you.amount = me.amount;
you.level = me.level;
@@ -179,6 +181,7 @@ CM.Sim.CopyData = function() {
var you = CM.Sim.Upgrades[i];
if (you == undefined) {
CM.Sim.InitData();
you = CM.Sim.Upgrades[i];
}
you.bought = me.bought;
}
@@ -189,6 +192,7 @@ CM.Sim.CopyData = function() {
var you = CM.Sim.Achievements[i];
if (you == undefined) {
CM.Sim.InitData();
you = CM.Sim.Achievements[i];
}
you.won = me.won;
}