Don't crash if 2 DockHosts overlap
This commit is contained in:
@@ -342,8 +342,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var mobile = clientActor.TraitOrDefault<Mobile>();
|
var mobile = clientActor.TraitOrDefault<Mobile>();
|
||||||
if (mobile != null)
|
if (mobile != null)
|
||||||
{
|
{
|
||||||
// Overlapping docks can become hidden.
|
// Overlapping hosts can become hidden.
|
||||||
var lookup = docks.ToDictionary(dock => clientActor.World.Map.CellContaining(dock.Trait.DockPosition));
|
var lookup = docks
|
||||||
|
.GroupBy(dock => clientActor.World.Map.CellContaining(dock.Trait.DockPosition))
|
||||||
|
.ToDictionary(group => group.Key, group => group.First());
|
||||||
|
|
||||||
// Start a search from each docks position:
|
// Start a search from each docks position:
|
||||||
var path = mobile.PathFinder.FindPathToTargetCell(
|
var path = mobile.PathFinder.FindPathToTargetCell(
|
||||||
|
|||||||
Reference in New Issue
Block a user