Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Builder.js
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/** | /** | ||||
* Build/repair the target entity. This should only be called after a successful range check. | * Build/repair the target entity. This should only be called after a successful range check. | ||||
* It should be called at a rate of once per second. | * It should be called at a rate of once per second. | ||||
*/ | */ | ||||
Builder.prototype.PerformBuilding = function(target) | Builder.prototype.PerformBuilding = function(target) | ||||
{ | { | ||||
let rate = ApplyValueModificationsToEntity("Builder/Rate", +this.template.Rate, this.entity); | let rate = Math.floor(ApplyValueModificationsToEntity("Builder/Rate", +this.template.Rate, this.entity)); | ||||
let cmpFoundation = Engine.QueryInterface(target, IID_Foundation); | let cmpFoundation = Engine.QueryInterface(target, IID_Foundation); | ||||
if (cmpFoundation) | if (cmpFoundation) | ||||
{ | { | ||||
cmpFoundation.Build(this.entity, rate); | cmpFoundation.Build(this.entity, rate); | ||||
return; | return; | ||||
} | } | ||||
Show All 9 Lines |
Wildfire Games · Phabricator