Fix broken condition support for InstantlyRepairable.

This commit is contained in:
Mustafa Alperen Seki
2024-12-09 16:02:12 +03:00
committed by Gustas
parent 593c2735ce
commit fa01c24f23

View File

@@ -87,11 +87,11 @@ namespace OpenRA.Mods.Common.Traits
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;