Add ISingleInstanceInit interface.
Inits that are logically singletons (e.g. actor location or owner) should implement this interface to avoid runtime inconsistencies. Duplicate instances are rejected at init-time, allowing simpler queries when they are used.
This commit is contained in:
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
var body = init.Actor.TraitInfo<BodyOrientationInfo>();
|
||||
var faction = init.GetValue<FactionInit, string>(this);
|
||||
var ownerName = init.Get<OwnerInit>(this).InternalName;
|
||||
var ownerName = init.Get<OwnerInit>().InternalName;
|
||||
var sequenceProvider = init.World.Map.Rules.Sequences;
|
||||
var image = Image ?? init.Actor.Name;
|
||||
var facings = body.QuantizedFacings == -1 ?
|
||||
|
||||
Reference in New Issue
Block a user