Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js @@ -545,38 +545,42 @@ return true; // Still nothing, we look now for faraway resources, first in the accessible ones, then in the others - if (this.accessIndex === access) + // except for food which is not worth (farms or corrals should be used) + if (resource !== "food") { - if ((supply = findSupply(this.ent, this.base.dropsiteSupplies[resource].faraway))) + if (this.accessIndex === access) { - this.ent.gather(supply); - return true; + if ((supply = findSupply(this.ent, this.base.dropsiteSupplies[resource].faraway))) + { + this.ent.gather(supply); + return true; + } } - } - for (let base of gameState.ai.HQ.baseManagers) - { - if (base.ID === this.baseID) - continue; - if (base.accessIndex !== access) - continue; - if ((supply = findSupply(this.ent, base.dropsiteSupplies[resource].faraway))) + for (let base of gameState.ai.HQ.baseManagers) { - this.ent.setMetadata(PlayerID, "base", base.ID); - this.ent.gather(supply); - return true; + if (base.ID === this.baseID) + continue; + if (base.accessIndex !== access) + continue; + if ((supply = findSupply(this.ent, base.dropsiteSupplies[resource].faraway))) + { + this.ent.setMetadata(PlayerID, "base", base.ID); + this.ent.gather(supply); + return true; + } } - } - for (let base of gameState.ai.HQ.baseManagers) - { - if (base.accessIndex === access) - continue; - if ((supply = findSupply(this.ent, base.dropsiteSupplies[resource].faraway))) + for (let base of gameState.ai.HQ.baseManagers) { - if (navalManager.requireTransport(gameState, this.ent, access, base.accessIndex, supply.position())) + if (base.accessIndex === access) + continue; + if ((supply = findSupply(this.ent, base.dropsiteSupplies[resource].faraway))) { - if (base.ID !== this.baseID) - this.ent.setMetadata(PlayerID, "base", base.ID); - return true; + if (navalManager.requireTransport(gameState, this.ent, access, base.accessIndex, supply.position())) + { + if (base.ID !== this.baseID) + this.ent.setMetadata(PlayerID, "base", base.ID); + return true; + } } } }