Add an `Undamaged' damagestate to simplify things related to healing.
This commit is contained in:
@@ -34,9 +34,8 @@ namespace OpenRA.Mods.RA.Orders
|
||||
if (underCursor == null)
|
||||
yield break;
|
||||
|
||||
var health = underCursor.traits.GetOrDefault<Health>();
|
||||
var repairable = health != null && underCursor.Info.Traits.Contains<RepairableBuildingInfo>();
|
||||
if (repairable && health.HPFraction < 1f)
|
||||
if (underCursor.Info.Traits.Contains<RepairableBuildingInfo>()
|
||||
&& underCursor.GetExtendedDamageState() != ExtendedDamageState.Undamaged)
|
||||
yield return new Order("Repair", underCursor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user