From 96ddabb30cd40875643531baeee0884fa5b19a2e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 26 Apr 2024 21:56:30 +0100 Subject: [PATCH] Codechange: Remove write-only spec_id from RoadStopSpec. (#12582) Comment is incorrect about its value too. (cherry picked from commit 72c55128d2129f824a60a35fb5aa601409af4a3d) --- src/newgrf.cpp | 1 - src/newgrf_roadstop.h | 1 - src/table/newgrf_debug_data.h | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 7085887dfb..fdad9afda2 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5145,7 +5145,6 @@ static ChangeInfoResult RoadStopChangeInfo(uint id, int numinfo, int prop, const uint32_t classid = buf->ReadDWord(); rs->cls_id = RoadStopClass::Allocate(BSWAP32(classid)); - rs->spec_id = id + i; break; } diff --git a/src/newgrf_roadstop.h b/src/newgrf_roadstop.h index 61e12f11e2..6c8d3c3602 100644 --- a/src/newgrf_roadstop.h +++ b/src/newgrf_roadstop.h @@ -145,7 +145,6 @@ struct RoadStopSpec { */ GRFFilePropsBase grf_prop; RoadStopClassID cls_id; ///< The class to which this spec belongs. - int spec_id; ///< The ID of this spec inside the class. StringID name; ///< Name of this stop RoadStopAvailabilityType stop_type = ROADSTOPTYPE_ALL; diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 78b1b93f81..2d47aa9e53 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -2472,7 +2472,7 @@ class NIHRoadStop : public NIHelper { const RoadStopSpec *spec = GetRoadStopSpec(index); if (spec) { uint class_id = RoadStopClass::Get(spec->cls_id)->global_id; - char *b = buffer + seprintf(buffer, lastof(buffer), " class ID: %c%c%c%c, spec ID: %u", class_id >> 24, class_id >> 16, class_id >> 8, class_id, spec->spec_id); + char *b = buffer + seprintf(buffer, lastof(buffer), " class ID: %c%c%c%c", class_id >> 24, class_id >> 16, class_id >> 8, class_id); if (spec->grf_prop.grffile != nullptr) { b += seprintf(b, lastof(buffer), " (local ID: %u)", spec->grf_prop.local_id); }