Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 3,164 Lines • ▼ Show 20 Lines | "REPAIR": { | ||||
// If autocontinue explicitly disabled (e.g. by AI) then | // If autocontinue explicitly disabled (e.g. by AI) then | ||||
// do nothing automatically | // do nothing automatically | ||||
if (!oldData.autocontinue) | if (!oldData.autocontinue) | ||||
return; | return; | ||||
// If this building was e.g. a farm of ours, the entities that received | // If this building was e.g. a farm of ours, the entities that received | ||||
// the build command should start gathering from it | // the build command should start gathering from it | ||||
if ((oldData.force || oldData.autoharvest) && this.CanGather(msg.data.newentity)) | if ((oldData.force || oldData.autoharvest) && this.CanGather(msg.data.newentity) && | ||||
Engine.QueryInterface(msg.data.newentity, IID_ResourceSupply).IsAvailableTo(this.entity)) | |||||
{ | { | ||||
this.PerformGather(msg.data.newentity, true, false); | this.PerformGather(msg.data.newentity, true, false); | ||||
return; | return; | ||||
} | } | ||||
// If this building was e.g. a farmstead of ours, entities that received | // If this building was e.g. a farmstead of ours, entities that received | ||||
// the build command should look for nearby resources to gather | // the build command should look for nearby resources to gather | ||||
if ((oldData.force || oldData.autoharvest) && | if ((oldData.force || oldData.autoharvest) && | ||||
▲ Show 20 Lines • Show All 3,343 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator