Re-implement the insufficient funds warning in a simpler manner

This commit is contained in:
Oliver Brakmann
2016-04-08 22:19:36 +02:00
parent 41388b9c63
commit 87e1acfc9f
4 changed files with 25 additions and 5 deletions

View File

@@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Traits
var cost = Math.Max(1, (hpToRepair * Info.RepairPercent * buildingValue) / (health.MaxHP * 100));
// TakeCash will return false if the player can't pay, and will stop him from contributing this Tick
var activePlayers = Repairers.Count(player => player.PlayerActor.Trait<PlayerResources>().TakeCash(cost));
var activePlayers = Repairers.Count(player => player.PlayerActor.Trait<PlayerResources>().TakeCash(cost, true));
RepairActive = activePlayers > 0;