Merge pull request #10170 from abcdefg30/crashActorsNear
Fix a crash when producing an actor without OccupiesSpace...
This commit is contained in:
@@ -106,6 +106,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
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
|
// Work around for actors produced within the region not triggering until the second tick
|
||||||
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.LengthSquared)
|
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.LengthSquared)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user