Merge pull request #5801 from Mailaender/building-influence-crash

Fixed a crash when trying to capture husks that have been destroyed.
This commit is contained in:
Paul Chote
2014-07-05 11:36:54 +12:00
4 changed files with 11 additions and 1 deletions

View File

@@ -39,6 +39,9 @@ namespace OpenRA.Mods.RA.Activities
self.World.AddFrameEndTask(w =>
{
if (actor.IsDead())
return;
var lowEnoughHealth = health.HP <= capturableInfo.CaptureThreshold * health.MaxHP;
if (!capturesInfo.Sabotage || lowEnoughHealth || actor.Owner.NonCombatant)
{

View File

@@ -59,6 +59,9 @@ namespace OpenRA.Mods.RA.Activities
self.World.AddFrameEndTask(w =>
{
if (target.Actor.IsDead())
return;
var oldOwner = target.Actor.Owner;
target.Actor.ChangeOwner(self.Owner);