Properly clean up traits that used to hook only death.

This commit is contained in:
Paul Chote
2015-05-23 22:09:50 +01:00
parent 4ff309811f
commit 8ae3afa3c5
9 changed files with 47 additions and 12 deletions

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Reserve landing places for aircraft.")]
class ReservableInfo : TraitInfo<Reservable> { }
public class Reservable : ITick, INotifyKilled, INotifyOwnerChanged, INotifySold
public class Reservable : ITick, INotifyOwnerChanged, INotifySold, INotifyActorDisposing
{
Actor reservedFor;
Aircraft reservedForAircraft;
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
return res != null && res.reservedFor != null;
}
public void Killed(Actor self, AttackInfo e)
public void Disposing(Actor self)
{
if (reservedForAircraft != null)
reservedForAircraft.UnReserve();