Use INotifyOwnerChanged for updating internal references.

This commit is contained in:
Paul Chote
2014-10-13 19:43:11 +13:00
parent 8508fc5155
commit a08a3a3869
12 changed files with 45 additions and 33 deletions

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA
[Desc("Reserve landing places for aircraft.")]
class ReservableInfo : TraitInfo<Reservable> { }
public class Reservable : ITick, INotifyKilled, INotifyCapture, INotifySold
public class Reservable : ITick, INotifyKilled, INotifyOwnerChanged, INotifySold
{
Actor reservedFor;
Aircraft reservedForAircraft;
@@ -60,15 +60,15 @@ namespace OpenRA.Mods.RA
reservedForAircraft.UnReserve();
}
public void OnCapture (Actor self, Actor captor, Player oldOwner, Player newOwner)
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
{
if (reservedForAircraft != null)
reservedForAircraft.UnReserve();
}
public void Selling (Actor self) { Sold(self); }
public void Selling(Actor self) { Sold(self); }
public void Sold (Actor self)
public void Sold(Actor self)
{
if (reservedForAircraft != null)
reservedForAircraft.UnReserve();