Differential D4274 Diff 18732 ps/trunk/binaries/data/mods/public/simulation/components/ResourceGatherer.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/ResourceGatherer.js
Show First 20 Lines • Show All 499 Lines • ▼ Show 20 Lines | |||||
ResourceGatherer.prototype.OnOwnershipChanged = function(msg) | ResourceGatherer.prototype.OnOwnershipChanged = function(msg) | ||||
{ | { | ||||
if (msg.to == INVALID_PLAYER) | if (msg.to == INVALID_PLAYER) | ||||
{ | { | ||||
this.RemoveFromPlayerCounter(msg.from); | this.RemoveFromPlayerCounter(msg.from); | ||||
return; | return; | ||||
} | } | ||||
if (this.lastGathered && msg.from !== INVALID_PLAYER) | |||||
{ | |||||
const resource = this.lastGathered; | |||||
this.RemoveFromPlayerCounter(msg.from); | |||||
this.AddToPlayerCounter(resource); | |||||
} | |||||
this.RecalculateGatherRates(); | this.RecalculateGatherRates(); | ||||
this.RecalculateCapacities(); | this.RecalculateCapacities(); | ||||
}; | }; | ||||
ResourceGatherer.prototype.OnGlobalInitGame = function(msg) | ResourceGatherer.prototype.OnGlobalInitGame = function(msg) | ||||
{ | { | ||||
this.RecalculateGatherRates(); | this.RecalculateGatherRates(); | ||||
Show All 11 Lines |
Wildfire Games · Phabricator