summaryrefslogtreecommitdiff
path: root/src/newgrf_object.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-17 19:05:46 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commit514565fad6d3a7e93a24b53b29eb901ef4f6a166 (patch)
treebadaf632dd5047e6be442e606bee956184845479 /src/newgrf_object.cpp
parent11f178a312d1a601aa14f9188f05f4a4cd033cf9 (diff)
downloadopenttd-514565fad6d3a7e93a24b53b29eb901ef4f6a166.tar.xz
Codechange: Replace FOR_ALL_OBJECTS with range-based for loops
Diffstat (limited to 'src/newgrf_object.cpp')
-rw-r--r--src/newgrf_object.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp
index 417dc2a4e..34e18c43a 100644
--- a/src/newgrf_object.cpp
+++ b/src/newgrf_object.cpp
@@ -186,8 +186,7 @@ static uint32 GetNearbyObjectTileInformation(byte parameter, TileIndex tile, Obj
static uint32 GetClosestObject(TileIndex tile, ObjectType type, const Object *current)
{
uint32 best_dist = UINT32_MAX;
- const Object *o;
- FOR_ALL_OBJECTS(o) {
+ for (const Object *o : Object::Iterate()) {
if (o->type != type || o == current) continue;
best_dist = min(best_dist, DistanceManhattan(tile, o->location.tile));