Fixed ctnk desync #2448

This commit is contained in:
Curtis Shmyr
2012-10-21 15:43:30 -06:00
parent d1c20d6c72
commit f3d4b6541c

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.RA
{ {
if (order.OrderString == "ChronoshiftJump") if (order.OrderString == "ChronoshiftJump")
{ {
if (CanJumpTo(order.TargetLocation)) if (CanJumpTo(order.TargetLocation, true))
{ {
self.CancelActivity(); self.CancelActivity();
self.QueueActivity(new Teleport(null, order.TargetLocation, true)); self.QueueActivity(new Teleport(null, order.TargetLocation, true));
@@ -90,14 +90,14 @@ namespace OpenRA.Mods.RA
} }
} }
public bool CanJumpTo(CPos xy) public bool CanJumpTo(CPos xy, bool ignoreVis)
{ {
var movement = self.TraitOrDefault<IMove>(); var movement = self.TraitOrDefault<IMove>();
if (chargeTick <= 0 // Can jump if (chargeTick <= 0 // Can jump
&& self.World.LocalShroud.IsExplored(xy) // Not in shroud && (self.Location - xy).Length <= Info.JumpDistance // Within jump range
&& movement.CanEnterCell(xy) // Can enter cell && movement.CanEnterCell(xy) // Can enter cell
&& (self.Location - xy).Length <= Info.JumpDistance) // Within jump range && (ignoreVis || self.World.LocalShroud.IsExplored(xy))) // Not in shroud
return true; return true;
else else
return false; return false;
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.RA
var queued = mi.Modifiers.HasModifier(Modifiers.Shift); var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
var cinfo = self.Trait<ChronoshiftDeploy>(); var cinfo = self.Trait<ChronoshiftDeploy>();
if (cinfo.CanJumpTo(xy)) if (cinfo.CanJumpTo(xy, false))
{ {
self.World.CancelInputMode(); self.World.CancelInputMode();
yield return new Order("ChronoshiftJump", self, queued) { TargetLocation = xy }; yield return new Order("ChronoshiftJump", self, queued) { TargetLocation = xy };
@@ -131,7 +131,7 @@ namespace OpenRA.Mods.RA
public string GetCursor(World world, CPos xy, MouseInput mi) public string GetCursor(World world, CPos xy, MouseInput mi)
{ {
var cinfo = self.Trait<ChronoshiftDeploy>(); var cinfo = self.Trait<ChronoshiftDeploy>();
if (cinfo.CanJumpTo(xy)) if (cinfo.CanJumpTo(xy, false))
return "chrono-target"; return "chrono-target";
else else
return "move-blocked"; return "move-blocked";