summaryrefslogtreecommitdiff
path: root/src/newgrf_object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_object.cpp')
-rw-r--r--src/newgrf_object.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp
index 1db4b02c6..8eaff1385 100644
--- a/src/newgrf_object.cpp
+++ b/src/newgrf_object.cpp
@@ -190,7 +190,7 @@ static uint32 GetClosestObject(TileIndex tile, ObjectType type, const Object *cu
uint32 best_dist = UINT32_MAX;
const Object *o;
FOR_ALL_OBJECTS(o) {
- if (GetObjectType(o->location.tile) != type || o == current) continue;
+ if (o->type != type || o == current) continue;
best_dist = min(best_dist, DistanceManhattan(tile, o->location.tile));
}