Rename Actor.Destroy/Destroyed to Dispose/Disposed.
This commit is contained in:
@@ -33,7 +33,7 @@ namespace OpenRA
|
||||
[Sync] public Player Owner { get; set; }
|
||||
|
||||
public bool IsInWorld { get; internal set; }
|
||||
public bool Destroyed { get; private set; }
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
Activity currentActivity;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA
|
||||
public IEffectiveOwner EffectiveOwner { get { return effectiveOwner.Value; } }
|
||||
|
||||
public bool IsIdle { get { return currentActivity == null; } }
|
||||
public bool IsDead { get { return Destroyed || (health.Value == null ? false : health.Value.IsDead); } }
|
||||
public bool IsDead { get { return Disposed || (health.Value == null ? false : health.Value.IsDead); } }
|
||||
|
||||
public CPos Location { get { return occupySpace.Value.TopLeft; } }
|
||||
public WPos CenterPosition { get { return occupySpace.Value.CenterPosition; } }
|
||||
@@ -215,18 +215,18 @@ namespace OpenRA
|
||||
World.TraitDict.AddTrait(this, trait);
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
public void Dispose()
|
||||
{
|
||||
World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (Destroyed)
|
||||
if (Disposed)
|
||||
return;
|
||||
|
||||
if (IsInWorld)
|
||||
World.Remove(this);
|
||||
|
||||
World.TraitDict.RemoveActor(this);
|
||||
Destroyed = true;
|
||||
Disposed = true;
|
||||
|
||||
if (luaInterface != null)
|
||||
luaInterface.Value.OnActorDestroyed();
|
||||
@@ -238,7 +238,7 @@ namespace OpenRA
|
||||
{
|
||||
World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (Destroyed)
|
||||
if (Disposed)
|
||||
return;
|
||||
|
||||
var oldOwner = Owner;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
// added for contrails
|
||||
foreach (var a in World.ActorsWithTrait<IPostRender>())
|
||||
if (a.Actor.IsInWorld && !a.Actor.Destroyed)
|
||||
if (a.Actor.IsInWorld && !a.Actor.Disposed)
|
||||
a.Trait.RenderAfterWorld(this, a.Actor);
|
||||
|
||||
var renderShroud = World.RenderPlayer != null ? World.RenderPlayer.Shroud : null;
|
||||
@@ -154,7 +154,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
Game.Renderer.DisableScissor();
|
||||
|
||||
var overlayRenderables = World.Selection.Actors.Where(a => !a.Destroyed)
|
||||
var overlayRenderables = World.Selection.Actors.Where(a => !a.Disposed)
|
||||
.SelectMany(a => a.TraitsImplementing<IPostRenderSelection>())
|
||||
.SelectMany(t => t.RenderAfterWorld(this));
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
if (World.Type == WorldType.Regular && Game.Settings.Game.AlwaysShowStatusBars)
|
||||
{
|
||||
foreach (var g in World.Actors.Where(a => !a.Destroyed
|
||||
foreach (var g in World.Actors.Where(a => !a.Disposed
|
||||
&& a.HasTrait<Selectable>()
|
||||
&& !World.FogObscures(a)
|
||||
&& !World.Selection.Actors.Contains(a)))
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace OpenRA.Orders
|
||||
if (self.Owner != self.World.LocalPlayer)
|
||||
return null;
|
||||
|
||||
if (self.Destroyed || !target.IsValidFor(self))
|
||||
if (self.Disposed || !target.IsValidFor(self))
|
||||
return null;
|
||||
|
||||
if (mi.Button == Game.Settings.Game.MouseButtonPreference.Action)
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Scripting
|
||||
var commandClasses = Context.ActorCommands[actor.Info].AsEnumerable();
|
||||
|
||||
// Destroyed actors cannot have their traits queried
|
||||
if (actor.Destroyed)
|
||||
if (actor.Disposed)
|
||||
commandClasses = commandClasses.Where(c => c.HasAttribute<ExposedForDestroyedActors>());
|
||||
|
||||
var args = new object[] { Context, actor };
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA
|
||||
foreach (var cg in controlGroups.Values)
|
||||
{
|
||||
// note: NOT `!a.IsInWorld`, since that would remove things that are in transports.
|
||||
cg.RemoveAll(a => a.Destroyed || a.Owner != world.LocalPlayer);
|
||||
cg.RemoveAll(a => a.Disposed || a.Owner != world.LocalPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA
|
||||
|
||||
static void CheckDestroyed(Actor actor)
|
||||
{
|
||||
if (actor.Destroyed)
|
||||
if (actor.Disposed)
|
||||
throw new InvalidOperationException("Attempted to get trait from destroyed object ({0})".F(actor));
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace OpenRA.Traits
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (self.Destroyed)
|
||||
if (self.Disposed)
|
||||
return;
|
||||
|
||||
var line = self.TraitOrDefault<DrawLineToTarget>();
|
||||
@@ -120,7 +120,7 @@ namespace OpenRA.Traits
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (self.Destroyed)
|
||||
if (self.Disposed)
|
||||
return;
|
||||
|
||||
target.Flash();
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace OpenRA.Traits
|
||||
nd.Killed(self, ai);
|
||||
|
||||
if (RemoveOnDeath)
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
|
||||
Log.Write("debug", "{0} #{1} killed by {2} #{3}", self.Info.Name, self.ActorID, attacker.Info.Name, attacker.ActorID);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
public static DamageState GetDamageState(this Actor self)
|
||||
{
|
||||
if (self.Destroyed)
|
||||
if (self.Disposed)
|
||||
return DamageState.Dead;
|
||||
|
||||
var health = self.TraitOrDefault<Health>();
|
||||
@@ -204,7 +204,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public static void InflictDamage(this Actor self, Actor attacker, int damage, DamageWarhead warhead)
|
||||
{
|
||||
if (self.Destroyed) return;
|
||||
if (self.Disposed) return;
|
||||
var health = self.TraitOrDefault<Health>();
|
||||
if (health == null) return;
|
||||
health.InflictDamage(self, attacker, damage, warhead, false);
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace OpenRA.Traits
|
||||
if (NeedRenderables)
|
||||
{
|
||||
NeedRenderables = false;
|
||||
if (!actor.Destroyed)
|
||||
if (!actor.Disposed)
|
||||
{
|
||||
IsRendering = true;
|
||||
renderables = actor.Render(wr).ToArray();
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace OpenRA.Traits
|
||||
yield break;
|
||||
|
||||
for (var i = influence[a]; i != null; i = i.Next)
|
||||
if (!i.Actor.Destroyed)
|
||||
if (!i.Actor.Disposed)
|
||||
yield return i.Actor;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace OpenRA.Traits
|
||||
yield break;
|
||||
|
||||
for (var i = influence[a]; i != null; i = i.Next)
|
||||
if (!i.Actor.Destroyed && (i.SubCell == sub || i.SubCell == SubCell.FullCell))
|
||||
if (!i.Actor.Disposed && (i.SubCell == sub || i.SubCell == SubCell.FullCell))
|
||||
yield return i.Actor;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace OpenRA.Traits
|
||||
|
||||
var always = sub == SubCell.FullCell || sub == SubCell.Any;
|
||||
for (var i = influence[a]; i != null; i = i.Next)
|
||||
if ((always || i.SubCell == sub || i.SubCell == SubCell.FullCell) && !i.Actor.Destroyed && withCondition(i.Actor))
|
||||
if ((always || i.SubCell == sub || i.SubCell == SubCell.FullCell) && !i.Actor.Disposed && withCondition(i.Actor))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA
|
||||
continue;
|
||||
|
||||
var orderSubject = o.Subject;
|
||||
if (orderSubject.Destroyed)
|
||||
if (orderSubject.Disposed)
|
||||
continue;
|
||||
|
||||
foreach (var voice in orderSubject.TraitsImplementing<IVoiced>())
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace OpenRA.Mods.Common.AI
|
||||
case BuildingType.Defense:
|
||||
|
||||
// Build near the closest enemy structure
|
||||
var closestEnemy = World.Actors.Where(a => !a.Destroyed && a.HasTrait<Building>() && Player.Stances[a.Owner] == Stance.Enemy)
|
||||
var closestEnemy = World.Actors.Where(a => !a.Disposed && a.HasTrait<Building>() && Player.Stances[a.Owner] == Stance.Enemy)
|
||||
.ClosestTo(World.Map.CenterOfCell(defenseCenter));
|
||||
|
||||
var targetCell = closestEnemy != null ? closestEnemy.Location : baseCenter;
|
||||
@@ -944,7 +944,7 @@ namespace OpenRA.Mods.Common.AI
|
||||
}
|
||||
}
|
||||
|
||||
if (e.Attacker.Destroyed)
|
||||
if (e.Attacker.Disposed)
|
||||
return;
|
||||
|
||||
if (!e.Attacker.HasTrait<ITargetable>())
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.AI
|
||||
else
|
||||
{
|
||||
var enemies = owner.World.FindActorsInCircle(leader.CenterPosition, WRange.FromCells(12))
|
||||
.Where(a1 => !a1.Destroyed && !a1.IsDead);
|
||||
.Where(a1 => !a1.Disposed && !a1.IsDead);
|
||||
var enemynearby = enemies.Where(a1 => a1.HasTrait<ITargetable>() && leader.Owner.Stances[a1.Owner] == Stance.Enemy);
|
||||
var target = enemynearby.ClosestTo(leader.CenterPosition);
|
||||
if (target != null)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
weapon.Impact(Target.FromPos(self.CenterPosition), self, Enumerable.Empty<int>());
|
||||
}
|
||||
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
actor.InflictDamage(self, damage, null);
|
||||
}
|
||||
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return;
|
||||
|
||||
target.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(payload);
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
|
||||
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
self.World.AddFrameEndTask(w => w.Add(new FloatingText(target.CenterPosition, target.Owner.Color.RGB, FloatingText.FormatCashTick(payload), 30)));
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
capturable.EndCapture();
|
||||
|
||||
if (capturesInfo != null && capturesInfo.ConsumeActor)
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (IsCanceled) return NextActivity;
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (hut.BridgeDamageState == DamageState.Undamaged || hut.Repairing || hut.Bridge.GetHut(0) == null || hut.Bridge.GetHut(1) == null)
|
||||
return;
|
||||
hut.Repair(self);
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (health.DamageState == DamageState.Undamaged)
|
||||
return;
|
||||
target.InflictDamage(self, -health.MaxHP, null);
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (refund > 0 && self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.Owner.Color.RGB, FloatingText.FormatCashTick(refund), 30)));
|
||||
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
var selected = w.Selection.Contains(self);
|
||||
var controlgroup = w.Selection.GetControlGroupForActor(self);
|
||||
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
foreach (var s in Sounds)
|
||||
Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
cargo.Unload(self);
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (actor.Destroyed)
|
||||
if (actor.Disposed)
|
||||
return;
|
||||
|
||||
var move = actor.Trait<IMove>();
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Commands
|
||||
|
||||
foreach (var actor in world.Selection.Actors)
|
||||
{
|
||||
if (actor.IsDead || actor.Destroyed)
|
||||
if (actor.IsDead || actor.Disposed)
|
||||
continue;
|
||||
|
||||
var leveluporder = new Order("DevLevelUp", actor, false);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
if (a.Destroyed || wr.World.FogObscures(a))
|
||||
if (a.Disposed || wr.World.FogObscures(a))
|
||||
return SpriteRenderable.None;
|
||||
|
||||
return anim.Render(a.CenterPosition, wr.Palette(canPowerDown.Info.IndicatorPalette));
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
if (building.Destroyed || wr.World.FogObscures(building) || rb.Repairers.Count == 0)
|
||||
if (building.Disposed || wr.World.FogObscures(building) || rb.Repairers.Count == 0)
|
||||
return SpriteRenderable.None;
|
||||
|
||||
PaletteReference palette;
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
if (!sma.Actors.TryGetValue(actorName, out ret))
|
||||
return null;
|
||||
|
||||
if (ret.Destroyed)
|
||||
if (ret.Disposed)
|
||||
return null;
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
void PerformKeyboardOrderOnSelection(Func<Actor, Order> f)
|
||||
{
|
||||
var orders = world.Selection.Actors
|
||||
.Where(a => a.Owner == world.LocalPlayer && !a.Destroyed)
|
||||
.Where(a => a.Owner == world.LocalPlayer && !a.Disposed)
|
||||
.Select(f)
|
||||
.ToArray();
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
bool PerformStanceCycle()
|
||||
{
|
||||
var actor = world.Selection.Actors
|
||||
.Where(a => a.Owner == world.LocalPlayer && !a.Destroyed)
|
||||
.Where(a => a.Owner == world.LocalPlayer && !a.Disposed)
|
||||
.Select(a => Pair.New(a, a.TraitOrDefault<AutoTarget>()))
|
||||
.FirstOrDefault(a => a.Second != null);
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
bool PerformGuard()
|
||||
{
|
||||
var actors = world.Selection.Actors
|
||||
.Where(a => !a.Destroyed && a.Owner == world.LocalPlayer && a.HasTrait<Guard>());
|
||||
.Where(a => !a.Disposed && a.Owner == world.LocalPlayer && a.HasTrait<Guard>());
|
||||
|
||||
if (actors.Any())
|
||||
world.OrderGenerator = new GuardOrderGenerator(actors);
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.D2k.Activities
|
||||
|
||||
actor.World.AddFrameEndTask(_ =>
|
||||
{
|
||||
actor1.Destroy();
|
||||
actor1.Dispose();
|
||||
|
||||
// Harvester insurance
|
||||
if (!actor1.HasTrait<Harvester>())
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
foreach (var t in target.TraitsImplementing<INotifyInfiltrated>())
|
||||
t.Infiltrated(target, self);
|
||||
|
||||
self.Destroy();
|
||||
self.Dispose();
|
||||
|
||||
if (target.HasTrait<Building>())
|
||||
Sound.PlayToPlayer(self.Owner, "bldginf1.aud");
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
foreach (var a in self.World.ActorsWithTrait<ChronoshiftPaletteEffect>())
|
||||
a.Trait.Enable();
|
||||
|
||||
if (teleporter != null && self != teleporter && !teleporter.Destroyed)
|
||||
if (teleporter != null && self != teleporter && !teleporter.Disposed)
|
||||
{
|
||||
var building = teleporter.TraitOrDefault<RenderBuilding>();
|
||||
if (building != null)
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
public void Tick(World world)
|
||||
{
|
||||
if (self.Destroyed)
|
||||
if (self.Disposed)
|
||||
world.AddFrameEndTask(w => w.Remove(this));
|
||||
|
||||
show = false;
|
||||
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
if (!show || self.Destroyed)
|
||||
if (!show || self.Disposed)
|
||||
return SpriteRenderable.None;
|
||||
|
||||
var palette = wr.Palette(info.IndicatorPalettePrefix + self.Owner.InternalName);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
// damage is inflicted by the chronosphere
|
||||
if (!self.Destroyed)
|
||||
if (!self.Disposed)
|
||||
self.InflictDamage(chronosphere, int.MaxValue, null);
|
||||
});
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user