mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
some petra cleaning
This was SVN commit r18118.
This commit is contained in:
parent
462540585b
commit
bc19818e86
3 changed files with 10 additions and 10 deletions
|
|
@ -65,7 +65,7 @@ m.Config = function(difficulty)
|
|||
"mace": [ "structures/{civ}_siege_workshop", "structures/{civ}_library",
|
||||
"structures/{civ}_theatron" ],
|
||||
"maur": [ "structures/{civ}_elephant_stables", "structures/{civ}_pillar_ashoka" ],
|
||||
"pers": [ "structures/{civ}_stables", "structures/{civ}_apadana" ],
|
||||
"pers": [ "structures/{civ}_stables", "structures/{civ}_apadana", "structures/{civ}_hall"],
|
||||
"ptol": [ "structures/{civ}_library" ],
|
||||
"rome": [ "structures/{civ}_army_camp" ],
|
||||
"sele": [ "structures/{civ}_library" ],
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ m.NavalManager.prototype.checkEvents = function(gameState, queues, events)
|
|||
ent.getMetadata(PlayerID, "onBoard") === shipId)
|
||||
ent.setMetadata(PlayerID, "onBoard", undefined);
|
||||
});
|
||||
plan.needTransportShips = (plan.transportShips.length === 0);
|
||||
plan.needTransportShips = !plan.transportShips.hasEntities();
|
||||
}
|
||||
else if (plan.state === "sailing")
|
||||
{
|
||||
|
|
@ -479,8 +479,8 @@ m.NavalManager.prototype.maintainFleet = function(gameState, queues)
|
|||
{
|
||||
if (queues.ships.hasQueuedUnits())
|
||||
return;
|
||||
if (gameState.getOwnEntitiesByClass("Dock", true).filter(API3.Filters.isBuilt()).length +
|
||||
gameState.getOwnEntitiesByClass("Shipyard", true).filter(API3.Filters.isBuilt()).length === 0)
|
||||
if (!gameState.getOwnEntitiesByClass("Dock", true).filter(API3.Filters.isBuilt()).hasEntities() &&
|
||||
!gameState.getOwnEntitiesByClass("Shipyard", true).filter(API3.Filters.isBuilt()).hasEntities())
|
||||
return;
|
||||
// check if we have enough transport ships per region.
|
||||
for (var sea = 0; sea < this.seaShips.length; ++sea)
|
||||
|
|
@ -582,7 +582,7 @@ m.NavalManager.prototype.buildNavalStructures = function(gameState, queues)
|
|||
if (gameState.getPopulation() > this.Config.Economy.popForDock)
|
||||
{
|
||||
if (queues.dock.countQueuedUnitsWithClass("NavalMarket") === 0 &&
|
||||
gameState.getOwnStructures().filter(API3.Filters.and(API3.Filters.byClass("NavalMarket"), API3.Filters.isFoundation())).length === 0 &&
|
||||
!gameState.getOwnStructures().filter(API3.Filters.and(API3.Filters.byClass("NavalMarket"), API3.Filters.isFoundation())).hasEntities() &&
|
||||
gameState.ai.HQ.canBuild(gameState, "structures/{civ}_dock"))
|
||||
{
|
||||
let dockStarted = false;
|
||||
|
|
@ -611,7 +611,7 @@ m.NavalManager.prototype.buildNavalStructures = function(gameState, queues)
|
|||
queues.militaryBuilding.hasQueuedUnits() || this.bNaval.length === 0)
|
||||
return;
|
||||
var docks = gameState.getOwnStructures().filter(API3.Filters.byClass("Dock"));
|
||||
if (!docks.length)
|
||||
if (!docks.hasEntities())
|
||||
return;
|
||||
var nNaval = 0;
|
||||
for (let naval of this.bNaval)
|
||||
|
|
|
|||
|
|
@ -429,16 +429,16 @@ m.QueueManager.prototype.checkPausedQueues = function(gameState)
|
|||
if (toBePaused)
|
||||
{
|
||||
if (q === "field" && gameState.ai.HQ.needFarm &&
|
||||
gameState.getOwnStructures().filter(API3.Filters.byClass("Field")).length === 0)
|
||||
!gameState.getOwnStructures().filter(API3.Filters.byClass("Field")).hasEntities())
|
||||
toBePaused = false;
|
||||
if (q === "corral" && gameState.ai.HQ.needCorral &&
|
||||
gameState.getOwnStructures().filter(API3.Filters.byClass("Field")).length === 0)
|
||||
!gameState.getOwnStructures().filter(API3.Filters.byClass("Field")).hasEntities())
|
||||
toBePaused = false;
|
||||
if (q === "dock" && gameState.ai.HQ.needFish &&
|
||||
gameState.getOwnStructures().filter(API3.Filters.byClass("Dock")).length === 0)
|
||||
!gameState.getOwnStructures().filter(API3.Filters.byClass("Dock")).hasEntities())
|
||||
toBePaused = false;
|
||||
if (q === "ships" && gameState.ai.HQ.needFish &&
|
||||
gameState.ai.HQ.navalManager.ships.filter(API3.Filters.byClass("FishingBoat")).length === 0)
|
||||
!gameState.ai.HQ.navalManager.ships.filter(API3.Filters.byClass("FishingBoat")).hasEntities())
|
||||
toBePaused = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue