Fix crash due to conflicting access to collection in killed Cargo

This commit is contained in:
Oliver Brakmann
2019-03-27 00:49:33 +01:00
committed by abcdefg30
parent 1373a4e16e
commit 320717003f

View File

@@ -189,7 +189,9 @@ namespace OpenRA.Mods.Common.Traits
if (Transport == null)
return;
Transport.Trait<Cargo>().Unload(Transport, self);
// Something killed us, but it wasn't our transport blowing up. Remove us from the cargo.
if (!Transport.IsDead)
Transport.Trait<Cargo>().Unload(Transport, self);
}
}
}