Properly clean up traits that used to hook only death.
This commit is contained in:
@@ -225,6 +225,9 @@ namespace OpenRA
|
||||
if (IsInWorld)
|
||||
World.Remove(this);
|
||||
|
||||
foreach (var t in TraitsImplementing<INotifyActorDisposing>())
|
||||
t.Disposing(this);
|
||||
|
||||
World.TraitDict.RemoveActor(this);
|
||||
Disposed = true;
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ namespace OpenRA.Traits
|
||||
public interface INotifyDamageStateChanged { void DamageStateChanged(Actor self, AttackInfo e); }
|
||||
public interface INotifyRepair { void Repairing(Actor self, Actor host); }
|
||||
public interface INotifyKilled { void Killed(Actor self, AttackInfo e); }
|
||||
public interface INotifyActorDisposing { void Disposing(Actor self); }
|
||||
public interface INotifyAppliedDamage { void AppliedDamage(Actor self, Actor damaged, AttackInfo e); }
|
||||
public interface INotifyBuildComplete { void BuildingComplete(Actor self); }
|
||||
public interface INotifyBuildingPlaced { void BuildingPlaced(Actor self); }
|
||||
|
||||
Reference in New Issue
Block a user