Make the ICrushable implementation explicit

This commit is contained in:
abcdefg30
2016-01-22 11:01:26 +01:00
parent 8b59ce4dc2
commit f21d1f52e7
3 changed files with 15 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
void INotifyCrushed.WarnCrush(Actor self, Actor crusher, HashSet<string> crushClasses)
{
if (!CrushableBy(crushClasses, crusher.Owner))
if (!CrushableInner(crushClasses, crusher.Owner))
return;
var mobile = self.TraitOrDefault<Mobile>();
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
void INotifyCrushed.OnCrush(Actor self, Actor crusher, HashSet<string> crushClasses)
{
if (!CrushableBy(crushClasses, crusher.Owner))
if (!CrushableInner(crushClasses, crusher.Owner))
return;
Game.Sound.Play(info.CrushSound, crusher.CenterPosition);
@@ -71,7 +71,12 @@ namespace OpenRA.Mods.Common.Traits
self.Kill(crusher);
}
public bool CrushableBy(HashSet<string> crushClasses, Player crushOwner)
bool ICrushable.CrushableBy(HashSet<string> crushClasses, Player crushOwner)
{
return CrushableInner(crushClasses, crushOwner);
}
bool CrushableInner(HashSet<string> crushClasses, Player crushOwner)
{
// Only make actor crushable if it is on the ground.
if (!self.IsAtGroundLevel())