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>();
|
var mobile = self.Trait<Mobile>();
|
||||||
self.QueueActivity(mobile.ScriptedMove(left));
|
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)));
|
self.QueueActivity(new CallFunc(() => LoopTrack(self,left,right)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,4 +45,17 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
return NextActivity;
|
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