Ensure cells are within map bounds when checking if adjacent cells should be cleared during resource placement.