Fixed GetAdjacentBuildings error when called at map edge

This commit is contained in:
amevarashi 2023-03-24 17:32:34 +05:00
parent e37f45399e
commit fed4b54915
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ namespace RJWSexperience
results.Add(building);
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);
}
return results;