Replace IActorInit with an abstract class.
A shared ValueActorInit<T> is introduced to reduce duplication in the most common init cases, and an ActorInitActorReference allow actors to be referenced by map.yaml name.
This commit is contained in:
@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
// Defer to the end of tick as the lazy value may reference an actor that hasn't been created yet
|
||||
var chronosphereInit = init.GetOrDefault<ChronoshiftChronosphereInit>(info);
|
||||
if (chronosphereInit != null)
|
||||
init.World.AddFrameEndTask(w => chronosphere = chronosphereInit.Value(init.World).Value);
|
||||
init.World.AddFrameEndTask(w => chronosphere = chronosphereInit.Value.Actor(init.World).Value);
|
||||
}
|
||||
|
||||
IEnumerable<VariableObserver> IObservesVariables.GetVariableObservers()
|
||||
|
||||
Reference in New Issue
Block a user