|
|
@ -133,18 +133,20 @@ namespace GWConquest |
|
|
|
|
|
|
|
public void TryMoveToPlanet(Planet planet) |
|
|
|
{ |
|
|
|
if(entity.IsControlled && !State.IsInTransit |
|
|
|
&& currentZone.planet.IsConnectedTo(planet)) |
|
|
|
if(currentZone.zoneType == ZoneType.Space) |
|
|
|
{ |
|
|
|
MoveFormationEvent evnt = MoveFormationEvent.Create(Bolt.GlobalTargets.OnlyServer); |
|
|
|
evnt.Formation = entity; |
|
|
|
evnt.TargetZone = Zone.GetZoneId(planet.GetMainZone(ZoneType.Space)); |
|
|
|
evnt.Send(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
BoltLog.Info("Could not move formation {0} (controlled: {1}, in transit: {2}) to planet {3}", |
|
|
|
this, entity.IsControlled, State.IsInTransit, planet); |
|
|
|
var targetZone = planet.GetMainZone(ZoneType.Space); |
|
|
|
|
|
|
|
var shortestPath = Planet.PlanetPathfindingGraph.FindShortestPath(this, currentZone, targetZone); |
|
|
|
|
|
|
|
if(shortestPath != null) |
|
|
|
{ |
|
|
|
StartMovingOnPath(shortestPath.zones); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
BoltLog.Warn("No path found between {0} and {1}", currentZone.planet, planet); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -152,7 +154,6 @@ namespace GWConquest |
|
|
|
{ |
|
|
|
if (path.Count > 1 && entity.IsControlled && !State.IsInTransit) |
|
|
|
{ |
|
|
|
|
|
|
|
MoveFormationEvent evnt = MoveFormationEvent.Create(Bolt.GlobalTargets.OnlyServer); |
|
|
|
evnt.Formation = entity; |
|
|
|
evnt.TargetZone = Zone.GetZoneId(path[1]); |
|
|
|