Skip to content

Commit

Permalink
Fix broken condition support for InstantlyRepairable.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Dec 9, 2024
1 parent 4bf7c7f commit e8313d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OpenRA.Mods.Common/Traits/InstantlyRepairs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ bool IsValidOrder(Order order)

bool IsValidActor(Actor target)
{
var instantlyRepairable = target.Info.TraitInfoOrDefault<InstantlyRepairableInfo>();
if (instantlyRepairable == null)
var instantlyRepairable = target.TraitOrDefault<InstantlyRepairable>();
if (instantlyRepairable == null || instantlyRepairable.IsTraitDisabled)
return false;

if (!instantlyRepairable.Types.IsEmpty && !instantlyRepairable.Types.Overlaps(Info.Types))
if (!instantlyRepairable.Info.Types.IsEmpty && !instantlyRepairable.Info.Types.Overlaps(Info.Types))
return false;

return true;
Expand Down

0 comments on commit e8313d7

Please sign in to comment.