Actor properties consistency improved
This commit is contained in:
@@ -98,7 +98,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (IsCanceled || self.IsDead())
|
||||
if (IsCanceled || self.IsDead)
|
||||
return NextActivity;
|
||||
|
||||
if (!isCalculated)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
protected override void OnInside(Actor self)
|
||||
{
|
||||
if (actor.IsDead() || capturable.BeingCaptured)
|
||||
if (actor.IsDead || capturable.BeingCaptured)
|
||||
return;
|
||||
|
||||
var b = actor.TraitOrDefault<Building>();
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
if (b != null && b.Locked)
|
||||
b.Unlock();
|
||||
|
||||
if (actor.IsDead() || capturable.BeingCaptured)
|
||||
if (actor.IsDead || capturable.BeingCaptured)
|
||||
return;
|
||||
|
||||
var health = actor.Trait<Health>();
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (target.IsDead())
|
||||
if (target.IsDead)
|
||||
return;
|
||||
|
||||
for (var f = 0; f < flashes; f++)
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
w.Add(new DelayedAction(delay, () =>
|
||||
{
|
||||
if (target.IsDead())
|
||||
if (target.IsDead)
|
||||
return;
|
||||
|
||||
var modifiers = target.TraitsImplementing<IDamageModifier>()
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
protected override void OnInside(Actor self)
|
||||
{
|
||||
if (target.IsDead())
|
||||
if (target.IsDead)
|
||||
return;
|
||||
|
||||
target.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(payload);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (self.IsDead() || transport.IsDead() || !cargo.CanLoad(transport, self))
|
||||
if (self.IsDead || transport.IsDead || !cargo.CanLoad(transport, self))
|
||||
return;
|
||||
|
||||
cargo.Load(transport, self);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
var capturable = target.Actor.Trait<ExternalCapturable>();
|
||||
|
||||
if (IsCanceled || !self.IsInWorld || self.IsDead() || !target.IsValidFor(self))
|
||||
if (IsCanceled || !self.IsInWorld || self.IsDead || !target.IsValidFor(self))
|
||||
{
|
||||
if (capturable.CaptureInProgress)
|
||||
capturable.EndCapture();
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (target.Actor.IsDead())
|
||||
if (target.Actor.IsDead)
|
||||
return;
|
||||
|
||||
var oldOwner = target.Actor.Owner;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
public Hunt(Actor self)
|
||||
{
|
||||
var attack = self.Trait<AttackBase>();
|
||||
targets = self.World.Actors.Where(a => self != a && !a.IsDead() && a.IsInWorld && a.AppearsHostileTo(self)
|
||||
targets = self.World.Actors.Where(a => self != a && !a.IsDead && a.IsInWorld && a.AppearsHostileTo(self)
|
||||
&& a.HasTrait<Huntable>() && attack.HasAnyValidWeapons(Target.FromActor(a)));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
protected override void OnInside(Actor self)
|
||||
{
|
||||
if (target.IsDead() || target.Owner == self.Owner)
|
||||
if (target.IsDead || target.Owner == self.Owner)
|
||||
return;
|
||||
|
||||
foreach (var t in target.TraitsImplementing<INotifyInfiltrated>())
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA
|
||||
case State.Dock:
|
||||
ru.PlayCustomAnimation(self, "dock", () => {
|
||||
ru.PlayCustomAnimRepeating(self, "dock-loop");
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
if (proc.IsInWorld && !proc.IsDead)
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Docked(proc, self);
|
||||
state = State.Loop;
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA
|
||||
state = State.Wait;
|
||||
return this;
|
||||
case State.Loop:
|
||||
if (!proc.IsInWorld || proc.IsDead() || harv.TickUnload(self, proc))
|
||||
if (!proc.IsInWorld || proc.IsDead || harv.TickUnload(self, proc))
|
||||
state = State.Undock;
|
||||
return this;
|
||||
case State.Undock:
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.RA
|
||||
case State.Complete:
|
||||
harv.LastLinkedProc = harv.LinkedProc;
|
||||
harv.LinkProc(self, null);
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
if (proc.IsInWorld && !proc.IsDead)
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Undocked(proc, self);
|
||||
return NextActivity;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (self.IsDead())
|
||||
if (self.IsDead)
|
||||
return;
|
||||
|
||||
foreach (var nt in self.TraitsImplementing<INotifyTransform>())
|
||||
|
||||
Reference in New Issue
Block a user