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:
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self = init.Self;
|
||||
actorInfo = self.World.Map.Rules.Actors[info.IntoActor];
|
||||
buildingInfo = actorInfo.TraitInfoOrDefault<BuildingInfo>();
|
||||
faction = init.GetValue<FactionInit, string>(info, self.Owner.Faction.InternalName);
|
||||
faction = init.GetValue<FactionInit, string>(self.Owner.Faction.InternalName);
|
||||
}
|
||||
|
||||
public string VoicePhraseForOrder(Actor self, Order order)
|
||||
|
||||
Reference in New Issue
Block a user