Check properties exist in resourceSupplyAmount and resourceCarrying to avoid warnings. Code from wraitii
This was SVN commit r11587.
This commit is contained in:
parent
ed6e5bdaf0
commit
b7cf51be34
@ -323,9 +323,17 @@ var Entity = Class({
|
||||
return !this.isOwn(); // TODO: diplomacy
|
||||
},
|
||||
|
||||
resourceSupplyAmount: function() { return this._entity.resourceSupplyAmount; },
|
||||
resourceSupplyAmount: function() {
|
||||
if(this._entity.resourceSupplyAmount === undefined)
|
||||
return undefined;
|
||||
return this._entity.resourceSupplyAmount;
|
||||
},
|
||||
|
||||
resourceCarrying: function() { return this._entity.resourceCarrying; },
|
||||
resourceCarrying: function() {
|
||||
if(this._entity.resourceCarrying === undefined)
|
||||
return undefined;
|
||||
return this._entity.resourceCarrying;
|
||||
},
|
||||
|
||||
garrisoned: function() { return new EntityCollection(this._ai, this._entity.garrisoned); },
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user