Don't crash when the bullet bounces outside of the map.
This commit is contained in:
committed by
reaperrr
parent
0320dcdef9
commit
b4670345dd
@@ -235,8 +235,11 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
|
|
||||||
if (flightLengthReached && shouldBounce)
|
if (flightLengthReached && shouldBounce)
|
||||||
{
|
{
|
||||||
var terrainPos = world.Map.CellContaining(pos);
|
var cell = world.Map.CellContaining(pos);
|
||||||
if (info.InvalidBounceTerrain.Contains(world.Map.GetTerrainInfo(terrainPos).Type))
|
if (!world.Map.Contains(cell))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (info.InvalidBounceTerrain.Contains(world.Map.GetTerrainInfo(cell).Type))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (AnyValidTargetsInRadius(world, pos, info.Width, args.SourceActor, true))
|
if (AnyValidTargetsInRadius(world, pos, info.Width, args.SourceActor, true))
|
||||||
|
|||||||
Reference in New Issue
Block a user