Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 5,394 Lines • ▼ Show 20 Lines | UnitAI.prototype.ReturnResource = function(target, queued) | ||||
{ | { | ||||
this.WalkToTarget(target, queued); | this.WalkToTarget(target, queued); | ||||
return; | return; | ||||
} | } | ||||
this.AddOrder("ReturnResource", { "target": target, "force": true }, queued); | this.AddOrder("ReturnResource", { "target": target, "force": true }, queued); | ||||
}; | }; | ||||
UnitAI.prototype.CancelSetupTradeRoute = function(target) | |||||
{ | |||||
let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); | |||||
if (!cmpTrader) | |||||
return; | |||||
cmpTrader.RemoveTargetMarket(target); | |||||
if (this.IsFormationController()) | |||||
this.CallMemberFunction("CancelSetupTradeRoute", [target]); | |||||
} | |||||
/** | /** | ||||
* Adds trade order to the queue. Either walk to the first market, or | * Adds trade order to the queue. Either walk to the first market, or | ||||
* start a new route. Not forced, so it can be interrupted by attacks. | * start a new route. Not forced, so it can be interrupted by attacks. | ||||
* The possible route may be given directly as a SetupTradeRoute argument | * The possible route may be given directly as a SetupTradeRoute argument | ||||
* if coming from a RallyPoint, or through this.expectedRoute if a user command. | * if coming from a RallyPoint, or through this.expectedRoute if a user command. | ||||
*/ | */ | ||||
UnitAI.prototype.SetupTradeRoute = function(target, source, route, queued) | UnitAI.prototype.SetupTradeRoute = function(target, source, route, queued) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 846 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator