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

Comment is incorrect about its value too.

(cherry picked from commit 72c55128d2)
tmp-jgrpp
Peter Nelson 3 weeks ago committed by Jonathan G Rennison
parent 991b7a958e
commit 96ddabb30c

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

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

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

Loading…
Cancel
Save