Fixed GetAdjacentBuildings error when called at map edge
This commit is contained in:
parent
e37f45399e
commit
fed4b54915
|
@ -59,7 +59,7 @@ namespace RJWSexperience
|
||||||
results.Add(building);
|
results.Add(building);
|
||||||
foreach (IntVec3 pos in GenAdjFast.AdjacentCells8Way(pawn.Position))
|
foreach (IntVec3 pos in GenAdjFast.AdjacentCells8Way(pawn.Position))
|
||||||
{
|
{
|
||||||
if (edifice[pos] is T adjBuilding)
|
if (pos.InBounds(pawn.Map) && edifice[pos] is T adjBuilding)
|
||||||
results.Add(adjBuilding);
|
results.Add(adjBuilding);
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
|
Loading…
Reference in New Issue