Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/ResourceGatherer.js
Show First 20 Lines • Show All 352 Lines • ▼ Show 20 Lines | |||||
ResourceGatherer.prototype.OnGlobalInitGame = function(msg) | ResourceGatherer.prototype.OnGlobalInitGame = function(msg) | ||||
{ | { | ||||
this.RecalculateGatherRatesAndCapacities(); | this.RecalculateGatherRatesAndCapacities(); | ||||
}; | }; | ||||
ResourceGatherer.prototype.OnMultiplierChanged = function(msg) | ResourceGatherer.prototype.OnMultiplierChanged = function(msg) | ||||
{ | { | ||||
if (msg.player == QueryOwnerInterface(this.entity, IID_Player).GetPlayerID()) | let cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); | ||||
if (cmpPlayer && msg.player == cmpPlayer.GetPlayerID()) | |||||
this.RecalculateGatherRatesAndCapacities(); | this.RecalculateGatherRatesAndCapacities(); | ||||
}; | }; | ||||
Engine.RegisterComponentType(IID_ResourceGatherer, "ResourceGatherer", ResourceGatherer); | Engine.RegisterComponentType(IID_ResourceGatherer, "ResourceGatherer", ResourceGatherer); |
Wildfire Games · Phabricator