Add SimpleTeleport for non-chrono jumps (used in scripts etc)
This commit is contained in:
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
var mobile = self.Trait<Mobile>();
|
||||
self.QueueActivity(mobile.ScriptedMove(left));
|
||||
self.QueueActivity(new Teleport(null, right, false));
|
||||
self.QueueActivity(new SimpleTeleport(right));
|
||||
self.QueueActivity(new CallFunc(() => LoopTrack(self,left,right)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,4 +45,17 @@ namespace OpenRA.Mods.RA.Activities
|
||||
return NextActivity;
|
||||
}
|
||||
}
|
||||
|
||||
public class SimpleTeleport : Activity
|
||||
{
|
||||
CPos destination;
|
||||
|
||||
public SimpleTeleport(CPos destination) { this.destination = destination; }
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
self.Trait<ITeleportable>().SetPosition(self, destination);
|
||||
return NextActivity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user