Merge pull request #10170 from abcdefg30/crashActorsNear

Fix a crash when producing an actor without OccupiesSpace...
This commit is contained in:
Oliver Brakmann
2015-12-03 21:57:15 +01:00

View File

@@ -106,6 +106,10 @@ namespace OpenRA.Mods.Common.Traits
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
{
// If the produced Actor doesn't occupy space, it can't be in range
if (produced.OccupiesSpace == null)
return;
// Work around for actors produced within the region not triggering until the second tick
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.LengthSquared)
{