Fix IDE0039
This commit is contained in:
@@ -218,7 +218,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
foreach (var q in player.PlayerActor.TraitsImplementing<ClassicProductionQueue>().Where(q => q.Enabled))
|
||||
queues.Add(q.Info.Type, q);
|
||||
|
||||
Action<Actor, Actor> globalProductionHandler = (factory, unit) =>
|
||||
void GlobalProductionHandler(Actor factory, Actor unit)
|
||||
{
|
||||
if (factory.Owner != player)
|
||||
return;
|
||||
@@ -227,10 +227,10 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
|
||||
if (productionHandlers.ContainsKey(queue))
|
||||
productionHandlers[queue](factory, unit);
|
||||
};
|
||||
}
|
||||
|
||||
var triggers = TriggerGlobal.GetScriptTriggers(player.PlayerActor);
|
||||
triggers.OnOtherProducedInternal += globalProductionHandler;
|
||||
triggers.OnOtherProducedInternal += GlobalProductionHandler;
|
||||
}
|
||||
|
||||
[Desc("Build the specified set of actors using classic (RA-style) production queues. " +
|
||||
@@ -259,7 +259,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
var squad = new List<Actor>();
|
||||
var func = actionFunc.CopyReference() as LuaFunction;
|
||||
|
||||
Action<Actor, Actor> productionHandler = (factory, unit) =>
|
||||
void ProductionHandler(Actor factory, Actor unit)
|
||||
{
|
||||
squad.Add(unit);
|
||||
if (squad.Count >= squadSize)
|
||||
@@ -271,10 +271,10 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
foreach (var q in queueTypes)
|
||||
productionHandlers.Remove(q);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
foreach (var q in queueTypes)
|
||||
productionHandlers.Add(q, productionHandler);
|
||||
productionHandlers.Add(q, ProductionHandler);
|
||||
}
|
||||
|
||||
foreach (var actorType in actorTypes)
|
||||
|
||||
Reference in New Issue
Block a user