Remove IPreventsTeleport interface.

MadTank is changed to use conditions instead.
This has a side-benefit of disabling the move
cursor while deployed.
This commit is contained in:
Paul Chote
2018-08-12 21:30:41 +01:00
parent e6d552eee7
commit 6f864b055d
4 changed files with 19 additions and 9 deletions

View File

@@ -19,8 +19,6 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Activities
{
public interface IPreventsTeleport { bool PreventsTeleport(Actor self); }
public class Teleport : Activity
{
readonly Actor teleporter;
@@ -50,10 +48,6 @@ namespace OpenRA.Mods.Cnc.Activities
if (teleporter == self && pc != null && !pc.CanTeleport)
return NextActivity;
foreach (var condition in self.TraitsImplementing<IPreventsTeleport>())
if (condition.PreventsTeleport(self))
return NextActivity;
var bestCell = ChooseBestDestinationCell(self, destination);
if (bestCell == null)
return NextActivity;