Merge pull request #6334 from Mailaender/parachute-out-of-map
Fixed a crash when parachutes were spawned outside of the map
This commit is contained in:
@@ -154,6 +154,7 @@ namespace OpenRA.Traits
|
|||||||
public void AddInfluence(Actor self, IOccupySpace ios)
|
public void AddInfluence(Actor self, IOccupySpace ios)
|
||||||
{
|
{
|
||||||
foreach (var c in ios.OccupiedCells())
|
foreach (var c in ios.OccupiedCells())
|
||||||
|
if (map.Contains(c.First))
|
||||||
influence[c.First] = new InfluenceNode { Next = influence[c.First], SubCell = c.Second, Actor = self };
|
influence[c.First] = new InfluenceNode { Next = influence[c.First], SubCell = c.Second, Actor = self };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +162,9 @@ namespace OpenRA.Traits
|
|||||||
{
|
{
|
||||||
foreach (var c in ios.OccupiedCells())
|
foreach (var c in ios.OccupiedCells())
|
||||||
{
|
{
|
||||||
|
if (!map.Contains(c.First))
|
||||||
|
continue;
|
||||||
|
|
||||||
var temp = influence[c.First];
|
var temp = influence[c.First];
|
||||||
RemoveInfluenceInner(ref temp, self);
|
RemoveInfluenceInner(ref temp, self);
|
||||||
influence[c.First] = temp;
|
influence[c.First] = temp;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
public void Killed(Actor self, AttackInfo e)
|
public void Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (self.Owner.WinState == WinState.Lost)
|
if (self.Owner.WinState == WinState.Lost || !self.World.Map.Contains(self.Location))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var r = self.World.SharedRandom.Next(1, 100);
|
var r = self.World.SharedRandom.Next(1, 100);
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ namespace OpenRA.Mods.RA
|
|||||||
if (droppedAt.Contains(self.Location) || checkForSuitableCell && !IsSuitableCell(cargo.Peek(self), self.Location))
|
if (droppedAt.Contains(self.Location) || checkForSuitableCell && !IsSuitableCell(cargo.Peek(self), self.Location))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!self.World.Map.Contains(self.Location))
|
||||||
|
return;
|
||||||
|
|
||||||
// unload a dude here
|
// unload a dude here
|
||||||
droppedAt.Add(self.Location);
|
droppedAt.Add(self.Location);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user