From e2dd9677578833e09ec7d1ce07e80097ca4665ec Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Tue, 27 Oct 2015 22:00:26 +0000 Subject: [PATCH] Fix some reservation issues. - TakeOff.Tick was nulling a local variable, rather than the Reservation field - this is changed to call UnReserve which does the right thing. - Aircraft.ResolveOrder was missing an UnReserve call before setting a new reservation. --- OpenRA.Mods.Common/Activities/Air/TakeOff.cs | 7 +------ OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 3 +++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Air/TakeOff.cs b/OpenRA.Mods.Common/Activities/Air/TakeOff.cs index 24de372431..03dde21f70 100644 --- a/OpenRA.Mods.Common/Activities/Air/TakeOff.cs +++ b/OpenRA.Mods.Common/Activities/Air/TakeOff.cs @@ -30,12 +30,7 @@ namespace OpenRA.Mods.Common.Activities if (NextActivity == null) self.CancelActivity(); - var reservation = aircraft.Reservation; - if (reservation != null) - { - reservation.Dispose(); - reservation = null; - } + aircraft.UnReserve(); var host = aircraft.GetActorBelow(); var hasHost = host != null; diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 95ea12961a..45fac81c78 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -543,7 +543,10 @@ namespace OpenRA.Mods.Common.Traits { var res = order.TargetActor.TraitOrDefault(); if (res != null) + { + UnReserve(); Reservation = res.Reserve(order.TargetActor, self, this); + } Action enter = () => {