Unreserve helipads on heli death.
This commit is contained in:
@@ -75,8 +75,26 @@ namespace OpenRA.Mods.RA.Air
|
|||||||
public virtual object Create( ActorInitializer init ) { return new Aircraft( init , this ); }
|
public virtual object Create( ActorInitializer init ) { return new Aircraft( init , this ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Aircraft : IMove, IFacing, IOccupySpace, ISync
|
public class Aircraft : IMove, IFacing, IOccupySpace, ISync, INotifyDamage
|
||||||
{
|
{
|
||||||
|
public IDisposable reservation;
|
||||||
|
|
||||||
|
public void UnReserve()
|
||||||
|
{
|
||||||
|
if (reservation != null)
|
||||||
|
{
|
||||||
|
reservation.Dispose();
|
||||||
|
reservation = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Damaged(Actor self, AttackInfo e)
|
||||||
|
{
|
||||||
|
if (e.DamageState == DamageState.Dead)
|
||||||
|
UnReserve();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected readonly Actor self;
|
protected readonly Actor self;
|
||||||
[Sync]
|
[Sync]
|
||||||
public int Facing { get; set; }
|
public int Facing { get; set; }
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ namespace OpenRA.Mods.RA.Air
|
|||||||
|
|
||||||
class Helicopter : Aircraft, ITick, IIssueOrder, IResolveOrder, IOrderVoice
|
class Helicopter : Aircraft, ITick, IIssueOrder, IResolveOrder, IOrderVoice
|
||||||
{
|
{
|
||||||
public IDisposable reservation;
|
|
||||||
HelicopterInfo Info;
|
HelicopterInfo Info;
|
||||||
|
|
||||||
public Helicopter( ActorInitializer init, HelicopterInfo info) : base( init, info )
|
public Helicopter( ActorInitializer init, HelicopterInfo info) : base( init, info )
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ namespace OpenRA.Mods.RA.Air
|
|||||||
|
|
||||||
public class Plane : Aircraft, IIssueOrder, IResolveOrder, IOrderVoice, ITick, INotifyDamage, ISync
|
public class Plane : Aircraft, IIssueOrder, IResolveOrder, IOrderVoice, ITick, INotifyDamage, ISync
|
||||||
{
|
{
|
||||||
public IDisposable reservation;
|
|
||||||
[Sync]
|
[Sync]
|
||||||
public int2 RTBPathHash;
|
public int2 RTBPathHash;
|
||||||
|
|
||||||
@@ -78,21 +77,6 @@ namespace OpenRA.Mods.RA.Air
|
|||||||
return (order.OrderString == "Move" || order.OrderString == "Enter") ? "Move" : null;
|
return (order.OrderString == "Move" || order.OrderString == "Enter") ? "Move" : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnReserve()
|
|
||||||
{
|
|
||||||
if (reservation != null)
|
|
||||||
{
|
|
||||||
reservation.Dispose();
|
|
||||||
reservation = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
|
||||||
{
|
|
||||||
if (e.DamageState == DamageState.Dead)
|
|
||||||
UnReserve();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResolveOrder(Actor self, Order order)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (order.OrderString == "Move")
|
if (order.OrderString == "Move")
|
||||||
|
|||||||
Reference in New Issue
Block a user