Add replace init function

This commit is contained in:
Gustas
2025-01-08 16:27:27 +02:00
committed by Paul Chote
parent cccd40ca13
commit 9da921756d
4 changed files with 12 additions and 11 deletions

View File

@@ -38,10 +38,7 @@ namespace OpenRA.Mods.Common.Traits
// If an actor's doesn't have a valid owner transfer ownership to neutral
var ownerInit = actorReference.Get<OwnerInit>();
if (!world.Players.Any(p => p.InternalName == ownerInit.InternalName))
{
actorReference.Remove(ownerInit);
actorReference.Add(new OwnerInit(world.WorldActor.Owner));
}
actorReference.Replace(new OwnerInit(world.WorldActor.Owner));
actorReference.Add(new SkipMakeAnimsInit());
actorReference.Add(new SpawnedByMapInit());