Remove Do() and replace with foreach()
This commit is contained in:
@@ -95,14 +95,16 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
// Add buildables that have a build limit set and are not already in the list
|
||||
player.World.ActorsWithTrait<Buildable>()
|
||||
.Where(a =>
|
||||
a.Actor.Owner == player &&
|
||||
a.Actor.IsInWorld &&
|
||||
!a.Actor.IsDead &&
|
||||
!ret.ContainsKey(a.Actor.Info.Name) &&
|
||||
a.Actor.Info.TraitInfo<BuildableInfo>().BuildLimit > 0)
|
||||
.Do(b => ret[b.Actor.Info.Name].Add(b.Actor));
|
||||
var buildables = player.World.ActorsWithTrait<Buildable>()
|
||||
.Where(a =>
|
||||
a.Actor.Owner == player &&
|
||||
a.Actor.IsInWorld &&
|
||||
!a.Actor.IsDead &&
|
||||
!ret.ContainsKey(a.Actor.Info.Name) &&
|
||||
a.Actor.Info.TraitInfo<BuildableInfo>().BuildLimit > 0);
|
||||
|
||||
foreach (var buildable in buildables)
|
||||
ret[buildable.Actor.Info.Name].Add(buildable.Actor);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user