Don't crash when selling an actor using OnAllRemovedFromWorld

This commit is contained in:
abcdefg30
2015-02-27 21:38:37 +01:00
parent cee3d6cf9e
commit 28262df1e5

View File

@@ -196,7 +196,9 @@ namespace OpenRA.Mods.Common.Scripting
{
try
{
group.Remove(m);
if (!group.Remove(m))
return;
if (!group.Any())
{
copy.Call().Dispose();
@@ -259,10 +261,9 @@ namespace OpenRA.Mods.Common.Scripting
{
try
{
if (!group.Contains(m))
if (!group.Remove(m))
return;
group.Remove(m);
if (!group.Any())
{
copy.Call().Dispose();