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:
Paul Chote
2014-09-24 22:26:08 +12:00
3 changed files with 9 additions and 2 deletions

View File

@@ -154,13 +154,17 @@ namespace OpenRA.Traits
public void AddInfluence(Actor self, IOccupySpace ios)
{
foreach (var c in ios.OccupiedCells())
influence[c.First] = new InfluenceNode { Next = influence[c.First], SubCell = c.Second, Actor = self };
if (map.Contains(c.First))
influence[c.First] = new InfluenceNode { Next = influence[c.First], SubCell = c.Second, Actor = self };
}
public void RemoveInfluence(Actor self, IOccupySpace ios)
{
foreach (var c in ios.OccupiedCells())
{
if (!map.Contains(c.First))
continue;
var temp = influence[c.First];
RemoveInfluenceInner(ref temp, self);
influence[c.First] = temp;