Fix actors being added to world while world actors are being iterated
This commit is contained in:
committed by
Matthias Mailänder
parent
718c6d03cc
commit
1db982276a
@@ -55,7 +55,12 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
initDict.Add(new FacingInit(facing));
|
initDict.Add(new FacingInit(facing));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Context.World.CreateActor(addToWorld, actorType, initDict);
|
// The actor must be added to the world at the end of the tick.
|
||||||
|
var a = Context.World.CreateActor(false, actorType, initDict);
|
||||||
|
if (addToWorld)
|
||||||
|
Context.World.AddFrameEndTask(w => w.Add(a));
|
||||||
|
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Move(Actor actor, CPos dest)
|
void Move(Actor actor, CPos dest)
|
||||||
|
|||||||
Reference in New Issue
Block a user