From fe5754e2bd9eb57584a80acefcaf851724df04c7 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sat, 23 Jan 2016 15:39:03 +0100 Subject: [PATCH] Change the parameters of ICrushable.CrushableBy --- OpenRA.Game/Traits/TraitsInterfaces.cs | 2 +- OpenRA.Mods.Common/Traits/Crates/Crate.cs | 2 +- OpenRA.Mods.Common/Traits/Crushable.cs | 4 ++-- OpenRA.Mods.Common/Traits/Mobile.cs | 2 +- OpenRA.Mods.RA/Traits/Mine.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 50187777f5..f6195b08f2 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -304,7 +304,7 @@ namespace OpenRA.Traits [RequireExplicitImplementation] public interface ICrushable { - bool CrushableBy(HashSet crushClasses, Player owner); + bool CrushableBy(Actor self, Actor crusher, HashSet crushClasses); } [RequireExplicitImplementation] diff --git a/OpenRA.Mods.Common/Traits/Crates/Crate.cs b/OpenRA.Mods.Common/Traits/Crates/Crate.cs index ee09ad83e0..6b175539e0 100644 --- a/OpenRA.Mods.Common/Traits/Crates/Crate.cs +++ b/OpenRA.Mods.Common/Traits/Crates/Crate.cs @@ -198,7 +198,7 @@ namespace OpenRA.Mods.Common.Traits return GetAvailableSubCell(a, SubCell.Any, ignoreActor, checkTransientActors) != SubCell.Invalid; } - bool ICrushable.CrushableBy(HashSet crushClasses, Player owner) + bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet crushClasses) { // Crate can only be crushed if it is not in the air. return self.IsAtGroundLevel() && crushClasses.Contains(info.CrushClass); diff --git a/OpenRA.Mods.Common/Traits/Crushable.cs b/OpenRA.Mods.Common/Traits/Crushable.cs index 16f8e5466c..48fe759911 100644 --- a/OpenRA.Mods.Common/Traits/Crushable.cs +++ b/OpenRA.Mods.Common/Traits/Crushable.cs @@ -71,9 +71,9 @@ namespace OpenRA.Mods.Common.Traits self.Kill(crusher); } - bool ICrushable.CrushableBy(HashSet crushClasses, Player crushOwner) + bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet crushClasses) { - return CrushableInner(crushClasses, crushOwner); + return CrushableInner(crushClasses, crusher.Owner); } bool CrushableInner(HashSet crushClasses, Player crushOwner) diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 304109a2c2..806f82f2db 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -260,7 +260,7 @@ namespace OpenRA.Mods.Common.Traits foreach (var crushable in crushables) { lacksCrushability = false; - if (!crushable.CrushableBy(Crushes, self.Owner)) + if (!crushable.CrushableBy(otherActor, self, Crushes)) return true; } diff --git a/OpenRA.Mods.RA/Traits/Mine.cs b/OpenRA.Mods.RA/Traits/Mine.cs index 089ffb20dc..560492e69f 100644 --- a/OpenRA.Mods.RA/Traits/Mine.cs +++ b/OpenRA.Mods.RA/Traits/Mine.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA.Traits self.Kill(crusher); } - bool ICrushable.CrushableBy(HashSet crushClasses, Player owner) + bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet crushClasses) { return info.CrushClasses.Overlaps(crushClasses); }