Fix crashes with actors dying mid-projectile-flight
This commit is contained in:
@@ -72,6 +72,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public void Damaged(Actor self, AttackInfo e)
|
public void Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (!self.IsIdle) return;
|
if (!self.IsIdle) return;
|
||||||
|
if (e.Attacker.Destroyed) return;
|
||||||
|
|
||||||
// not a lot we can do about things we can't hurt... although maybe we should automatically run away?
|
// not a lot we can do about things we can't hurt... although maybe we should automatically run away?
|
||||||
var attack = self.Trait<AttackBase>();
|
var attack = self.Trait<AttackBase>();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
|
|||||||
if (e.DamageState == DamageState.Dead)
|
if (e.DamageState == DamageState.Dead)
|
||||||
{
|
{
|
||||||
// Prevent TK from giving exp
|
// Prevent TK from giving exp
|
||||||
if (e.Attacker == null || e.Attacker.Owner.Stances[ self.Owner ] == Stance.Ally )
|
if (e.Attacker == null || e.Attacker.Destroyed || e.Attacker.Owner.Stances[ self.Owner ] == Stance.Ally )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var info = self.Info.Traits.Get<GivesExperienceInfo>();
|
var info = self.Info.Traits.Get<GivesExperienceInfo>();
|
||||||
|
|||||||
Reference in New Issue
Block a user