We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f09a59 commit 4f51260Copy full SHA for 4f51260
1 file changed
OpenRA.Mods.Common/Traits/AutoTarget.cs
@@ -241,6 +241,10 @@ void INotifyDamage.Damaged(Actor self, AttackInfo e)
241
if (oat.TryGetAutoTargetOverride(self, out _))
242
return;
243
244
+ var owner = self.Owner;
245
+ if (owner == null)
246
+ return;
247
+
248
if (!attacker.IsInWorld)
249
{
250
// If the aggressor is in a transport, then attack the transport instead
@@ -250,7 +254,7 @@ void INotifyDamage.Damaged(Actor self, AttackInfo e)
254
}
251
255
252
256
// Don't fire at an invisible enemy when we can't move to reveal it
253
- if (!AllowMove && !attacker.CanBeViewedByPlayer(self.Owner))
257
+ if (!AllowMove && !attacker.CanBeViewedByPlayer(owner))
258
259
260
// Not a lot we can do about things we can't hurt... although maybe we should automatically run away?
0 commit comments