Change the parameters of ICrushable.CrushableBy
This commit is contained in:
@@ -304,7 +304,7 @@ namespace OpenRA.Traits
|
||||
[RequireExplicitImplementation]
|
||||
public interface ICrushable
|
||||
{
|
||||
bool CrushableBy(HashSet<string> crushClasses, Player owner);
|
||||
bool CrushableBy(Actor self, Actor crusher, HashSet<string> crushClasses);
|
||||
}
|
||||
|
||||
[RequireExplicitImplementation]
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return GetAvailableSubCell(a, SubCell.Any, ignoreActor, checkTransientActors) != SubCell.Invalid;
|
||||
}
|
||||
|
||||
bool ICrushable.CrushableBy(HashSet<string> crushClasses, Player owner)
|
||||
bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet<string> crushClasses)
|
||||
{
|
||||
// Crate can only be crushed if it is not in the air.
|
||||
return self.IsAtGroundLevel() && crushClasses.Contains(info.CrushClass);
|
||||
|
||||
@@ -71,9 +71,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self.Kill(crusher);
|
||||
}
|
||||
|
||||
bool ICrushable.CrushableBy(HashSet<string> crushClasses, Player crushOwner)
|
||||
bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet<string> crushClasses)
|
||||
{
|
||||
return CrushableInner(crushClasses, crushOwner);
|
||||
return CrushableInner(crushClasses, crusher.Owner);
|
||||
}
|
||||
|
||||
bool CrushableInner(HashSet<string> crushClasses, Player crushOwner)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
self.Kill(crusher);
|
||||
}
|
||||
|
||||
bool ICrushable.CrushableBy(HashSet<string> crushClasses, Player owner)
|
||||
bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet<string> crushClasses)
|
||||
{
|
||||
return info.CrushClasses.Overlaps(crushClasses);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user