Merge pull request #8268 from obrakmann/fix8262_d2k_double_remove_from_world
Fix potentially removing actors twice from world in Actor::ChangeOwner
This commit is contained in:
@@ -242,11 +242,16 @@ namespace OpenRA
|
||||
return;
|
||||
|
||||
var oldOwner = Owner;
|
||||
var wasInWorld = IsInWorld;
|
||||
|
||||
// momentarily remove from world so the ownership queries don't get confused
|
||||
if (wasInWorld)
|
||||
w.Remove(this);
|
||||
|
||||
Owner = newOwner;
|
||||
Generation++;
|
||||
|
||||
if (wasInWorld)
|
||||
w.Add(this);
|
||||
|
||||
foreach (var t in this.TraitsImplementing<INotifyOwnerChanged>())
|
||||
|
||||
Reference in New Issue
Block a user