Codechange: Remove write-only spec_id from RoadStopSpec. (#12582)

Comment is incorrect about its value too.

(cherry picked from commit 72c55128d2129f824a60a35fb5aa601409af4a3d)
This commit is contained in:
Peter Nelson
2024-04-26 21:56:30 +01:00
committed by Jonathan G Rennison
parent 991b7a958e
commit 96ddabb30c
3 changed files with 1 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -145,7 +145,6 @@ struct RoadStopSpec {
*/
GRFFilePropsBase<NUM_CARGO + 3> 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;

View File

@@ -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);
}