Fix previous commit and OOS and rejoin. I need to get my hands on the guy that decided "init" wasn't called on deserialize.

This was SVN commit r17254.
This commit is contained in:
wraitii 2015-11-14 18:41:52 +00:00
parent 3473828735
commit 14f53315d6
2 changed files with 12 additions and 2 deletions

View File

@ -102,8 +102,13 @@ Identity.prototype.Schema =
Identity.prototype.Init = function()
{
// caching
this.classesList = GetIdentityClasses(this.template);;
this.visibleClassesList = GetVisibleIdentityClasses(this.template);;
this.classesList = GetIdentityClasses(this.template);
this.visibleClassesList = GetVisibleIdentityClasses(this.template);
};
Identity.prototype.Deserialize = function ()
{
this.Init();
};
Identity.prototype.Serialize = null; // we have no dynamic state to save

View File

@ -69,6 +69,11 @@ ResourceGatherer.prototype.Init = function()
this.RecalculateGatherRatesAndCapacities();
};
ResourceGatherer.prototype.Deserialize = function ()
{
this.RecalculateGatherRatesAndCapacities();
};
/**
* Returns data about what resources the unit is currently carrying,
* in the form [ {"type":"wood", "amount":7, "max":10} ]