From 7b08170ac8c91d8db0f8eb358eeb9f3e9cbaabf9 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 28 Apr 2025 16:08:56 +0200 Subject: [PATCH] Codechange: Replace a magic value with a maybe less magical constant. --- src/newgrf_station.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index aa17efa18c..b36a837308 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -635,14 +635,14 @@ StationResolverObject::StationResolverObject(const StationSpec *statspec, BaseSt * @param st Station (nullptr in GUI) * @param tile Station tile being drawn (INVALID_TILE in GUI) * @param var10 Value to put in variable 10; normally 0; 1 when resolving the groundsprite and StationSpecFlag::SeparateGround is set. - * @return First sprite of the Action 1 spriteset to use, minus an offset of 0x42D to accommodate for weird NewGRF specs. + * @return First sprite of the Action 1 spriteset to use, minus an offset of SPR_RAIL_PLATFORM_Y_FRONT (0x42D) to accommodate for weird NewGRF specs. */ SpriteID GetCustomStationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint32_t var10) { StationResolverObject object(statspec, st, tile, CBID_NO_CALLBACK, var10); const SpriteGroup *group = object.Resolve(); if (group == nullptr || group->type != SGT_RESULT) return 0; - return group->GetResult() - 0x42D; + return group->GetResult() - SPR_RAIL_PLATFORM_Y_FRONT; } /**