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:
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public TransformOnCapture(ActorInitializer init, TransformOnCaptureInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
faction = init.GetValue<FactionInit, string>(info, init.Self.Owner.Faction.InternalName);
|
||||
faction = init.GetValue<FactionInit, string>(init.Self.Owner.Faction.InternalName);
|
||||
}
|
||||
|
||||
void INotifyCapture.OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner, BitSet<CaptureType> captureTypes)
|
||||
|
||||
Reference in New Issue
Block a user