Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 5,419 Lines • ▼ Show 20 Lines | UnitAI.prototype.Attack = function(target, allowCapture = true, queued = false, pushFront = false) | ||||
this.AddOrder("Attack", order, queued, pushFront); | this.AddOrder("Attack", order, queued, pushFront); | ||||
}; | }; | ||||
/** | /** | ||||
* Adds garrison order to the queue, forced by the player. | * Adds garrison order to the queue, forced by the player. | ||||
*/ | */ | ||||
UnitAI.prototype.Garrison = function(target, queued, pushFront) | UnitAI.prototype.Garrison = function(target, queued, pushFront) | ||||
{ | { | ||||
// Not allowed to garrison when occupying a turret, at the moment. | |||||
if (this.isGarrisoned) | |||||
return; | |||||
if (target == this.entity) | if (target == this.entity) | ||||
return; | return; | ||||
if (!this.CanGarrison(target)) | if (!this.CanGarrison(target)) | ||||
{ | { | ||||
this.WalkToTarget(target, queued); | this.WalkToTarget(target, queued); | ||||
return; | return; | ||||
} | } | ||||
this.AddOrder("Garrison", { "target": target, "force": true, "garrison": true }, queued, pushFront); | this.AddOrder("Garrison", { "target": target, "force": true, "garrison": true }, queued, pushFront); | ||||
▲ Show 20 Lines • Show All 962 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator