Fixes #4955 aircraft reservation crash
Fixes the specific cause of the crash reported in #4955 with HeliReturn and adds an UnReserve call while attempting to reserve spawn building in Aircraft.cs
This commit is contained in:
@@ -80,9 +80,13 @@ namespace OpenRA.Mods.RA.Air
|
||||
return;
|
||||
|
||||
var res = afld.Trait<Reservable>();
|
||||
|
||||
if (res != null)
|
||||
{
|
||||
UnReserve();
|
||||
Reservation = res.Reserve(afld, self, this);
|
||||
}
|
||||
}
|
||||
|
||||
public void UnReserve()
|
||||
{
|
||||
|
||||
@@ -47,9 +47,12 @@ namespace OpenRA.Mods.RA.Air
|
||||
|
||||
var res = dest.TraitOrDefault<Reservable>();
|
||||
var heli = self.Trait<Helicopter>();
|
||||
if (res != null)
|
||||
heli.Reservation = res.Reserve(dest, self, heli);
|
||||
|
||||
if (res != null)
|
||||
{
|
||||
heli.UnReserve();
|
||||
heli.Reservation = res.Reserve(dest, self, heli);
|
||||
}
|
||||
var exit = dest.Info.Traits.WithInterface<ExitInfo>().FirstOrDefault();
|
||||
var offset = (exit != null) ? exit.SpawnOffset : WVec.Zero;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user