Rename Actor.Destroy/Destroyed to Dispose/Disposed.
This commit is contained in:
@@ -75,10 +75,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
var attacker = e.Attacker;
|
||||
if (attacker.Destroyed || Stance < UnitStance.ReturnFire)
|
||||
if (attacker.Disposed || Stance < UnitStance.ReturnFire)
|
||||
return;
|
||||
|
||||
if (!attacker.IsInWorld && !attacker.Destroyed)
|
||||
if (!attacker.IsInWorld && !attacker.Disposed)
|
||||
{
|
||||
// If the aggressor is in a transport, then attack the transport instead
|
||||
var passenger = attacker.TraitOrDefault<Passenger>();
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var crateActions = self.TraitsImplementing<CrateAction>();
|
||||
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
collected = true;
|
||||
|
||||
if (crateActions.Any())
|
||||
@@ -112,13 +112,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (collector != null)
|
||||
OnCrush(collector);
|
||||
else
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (info.Lifetime != 0 && ++ticks >= info.Lifetime * 25)
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
}
|
||||
|
||||
public CPos TopLeft { get { return Location; } }
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
else
|
||||
pilot.Destroy();
|
||||
pilot.Dispose();
|
||||
}
|
||||
|
||||
static bool IsSuitableCell(Actor self, Actor actorToDrop)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var info = self.Info.Traits.Get<GivesBountyInfo>();
|
||||
|
||||
if (e.Attacker == null || e.Attacker.Destroyed) return;
|
||||
if (e.Attacker == null || e.Attacker.Disposed) return;
|
||||
|
||||
if (!info.Stances.Contains(e.Attacker.Owner.Stances[self.Owner])) return;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void Killed(Actor self, AttackInfo e)
|
||||
{
|
||||
// Prevent TK from giving exp
|
||||
if (e.Attacker == null || e.Attacker.Destroyed || (!info.FriendlyFire && e.Attacker.Owner.Stances[self.Owner] == Stance.Ally))
|
||||
if (e.Attacker == null || e.Attacker.Disposed || (!info.FriendlyFire && e.Attacker.Owner.Stances[self.Owner] == Stance.Ally))
|
||||
return;
|
||||
|
||||
var valued = self.Info.Traits.GetOrDefault<ValuedInfo>();
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void SetProcLines(Actor proc)
|
||||
{
|
||||
if (proc == null) return;
|
||||
if (proc.Destroyed) return;
|
||||
if (proc.Disposed) return;
|
||||
|
||||
var linkedHarvs = proc.World.ActorsWithTrait<Harvester>()
|
||||
.Where(a => a.Trait.LinkedProc == proc)
|
||||
@@ -156,7 +156,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
// Check that we're not in a critical location and being useless (refinery drop-off):
|
||||
var lastproc = LastLinkedProc ?? LinkedProc;
|
||||
if (lastproc != null && !lastproc.Destroyed)
|
||||
if (lastproc != null && !lastproc.Disposed)
|
||||
{
|
||||
var deliveryLoc = lastproc.Location + lastproc.Trait<IAcceptResources>().DeliveryOffset;
|
||||
if (self.Location == deliveryLoc)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
if (Info.RemoveInstead || !self.HasTrait<Health>())
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
else
|
||||
self.Kill(self);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (self.Destroyed)
|
||||
if (self.Disposed)
|
||||
return;
|
||||
|
||||
VisibilityHash = 0;
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (self.Destroyed || captor.Destroyed) return;
|
||||
if (self.Disposed || captor.Disposed) return;
|
||||
|
||||
var previousOwner = self.Owner;
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
IEnumerable<Actor> UnitsInRange()
|
||||
{
|
||||
return Self.World.FindActorsInCircle(Self.CenterPosition, WRange.FromCells(Info.Range))
|
||||
.Where(a => a.IsInWorld && a != Self && !a.Destroyed && !a.Owner.NonCombatant);
|
||||
.Where(a => a.IsInWorld && a != Self && !a.Disposed && !a.Owner.NonCombatant);
|
||||
}
|
||||
|
||||
bool IsClear(Actor self, Player currentOwner, Player originalOwner)
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (!self.Destroyed)
|
||||
if (!self.Disposed)
|
||||
w.Add(new Corpse(w, self.CenterPosition, rs.GetImage(self), sequence, palette));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
void ActorEntered(Actor a)
|
||||
{
|
||||
if (a.Destroyed)
|
||||
if (a.Disposed)
|
||||
return;
|
||||
|
||||
if (a == self && !info.AffectsParent)
|
||||
@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
void ActorExited(Actor a)
|
||||
{
|
||||
if (a == self || a.Destroyed)
|
||||
if (a == self || a.Disposed)
|
||||
return;
|
||||
|
||||
var stance = self.Owner.Stances[a.Owner];
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
if (claimByActor.Remove(claim.Claimer) & claimByCell.Remove(claim.Cell))
|
||||
{
|
||||
if (claim.Claimer.Destroyed) return;
|
||||
if (claim.Claimer.Disposed) return;
|
||||
if (!claim.Claimer.IsInWorld) return;
|
||||
if (claim.Claimer.IsDead) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user