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:
@@ -65,8 +65,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var body = self.Trait<BodyOrientation>();
|
||||
|
||||
// TODO: Carry orientation over from the parent instead of just facing
|
||||
var dynamicFacingInit = init.GetOrDefault<DynamicFacingInit>(info);
|
||||
var bodyFacing = dynamicFacingInit != null ? dynamicFacingInit.Value() : init.GetValue<FacingInit, int>(info, 0);
|
||||
var dynamicFacingInit = init.GetOrDefault<DynamicFacingInit>();
|
||||
var bodyFacing = dynamicFacingInit != null ? dynamicFacingInit.Value() : init.GetValue<FacingInit, int>(0);
|
||||
facing = WAngle.FromFacing(Turreted.TurretFacingFromInit(init, info, 0)());
|
||||
|
||||
// Calculate final position
|
||||
|
||||
Reference in New Issue
Block a user