Fix CA1854
This commit is contained in:
committed by
Pavel Penev
parent
c2568ebd1f
commit
c8efc5fdd7
@@ -308,11 +308,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
clientActor, lookup.Keys, clientActor.Location, BlockedByActor.None,
|
||||
location =>
|
||||
{
|
||||
if (!lookup.ContainsKey(location))
|
||||
if (!lookup.TryGetValue(location, out var dock))
|
||||
return 0;
|
||||
|
||||
var dock = lookup[location];
|
||||
|
||||
// Prefer docks with less occupancy (multiplier is to offset distance cost):
|
||||
// TODO: add custom wieghts. E.g. owner vs allied.
|
||||
return dock.Trait.ReservationCount * client.OccupancyCostModifier;
|
||||
|
||||
Reference in New Issue
Block a user