Skip to content

Commit

Permalink
Rebase fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Jun 19, 2024
1 parent 557820d commit ef337fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,8 @@ ActorInfo ChooseBuildingToBuild(ProductionQueue queue)
|| !AIUtils.IsAreaAvailable<GivesBuildableArea>(world, player, world.Map, baseBuilder.Info.CheckForWaterRadius, baseBuilder.Info.WaterTerrainTypes)))
continue;

// Maybe we can't queue this because of InstantCashDrain logic?
var actor = world.Map.Rules.Actors[name];
if (playerResources != null && queue.Info.InstantCashDrain)
{
var cost = queue.GetProductionCost(actor);
if (playerResources.GetCashAndResources() < cost)
continue;
}

// Will this put us into low power?
var actor = world.Map.Rules.Actors[name];
if (baseBuilder.PlayerPower != null && (baseBuilder.ExcessPower < minimumExcessPower || !HasSufficientPowerForActor(actor)))
{
// Try building a power plant instead
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void INotifySelection.SelectionChanged()
.FirstOrDefault(q => q.Enabled && types.Contains(q.Info.Type));
}

if (queue == null || !queue.AnyItemsToBuild() && !queue.AlwaysVisible))
if (queue == null || (!queue.AnyItemsToBuild() && !queue.AlwaysVisible))
return;

if (tabsWidget.Value != null)
Expand Down

0 comments on commit ef337fd

Please sign in to comment.