Merge pull request #6945 from Phrohdoh/madtank-fix

MadTank deployed teleportation fix.
This commit is contained in:
Paul Chote
2014-11-16 17:31:46 +13:00
3 changed files with 12 additions and 2 deletions

View File

@@ -16,6 +16,8 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA.Activities
{
public interface IPreventsTeleport { bool PreventsTeleport(Actor self); }
public class Teleport : Activity
{
Actor chronosphere;
@@ -46,6 +48,10 @@ namespace OpenRA.Mods.RA.Activities
if (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;