diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf.cpp | 5 | ||||
-rw-r--r-- | src/newgrf_station.cpp | 4 | ||||
-rw-r--r-- | src/newgrf_station.h | 7 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 505f3ee50..6009d91b6 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3885,6 +3885,11 @@ static void StationMapSpriteGroup(ByteReader *buf, uint8 idcount) continue; } + if (statspec->grf_prop.grffile != NULL) { + grfmsg(1, "StationMapSpriteGroup: Station with ID 0x%02X mapped multiple times, skipping", stations[i]); + continue; + } + statspec->spritegroup[CT_DEFAULT] = _cur_grffile->spritegroups[groupid]; statspec->grf_prop.grffile = _cur_grffile; statspec->grf_prop.local_id = stations[i]; diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index e341bd43f..921c1e128 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -173,9 +173,6 @@ void SetCustomStationSpec(StationSpec *statspec) StationClass *station_class; int i; - /* If the station has already been allocated, don't reallocate it. */ - if (statspec->allocated) return; - assert(statspec->cls_id < STAT_CLASS_MAX); station_class = &_station_classes[statspec->cls_id]; @@ -183,7 +180,6 @@ void SetCustomStationSpec(StationSpec *statspec) station_class->spec = ReallocT(station_class->spec, station_class->stations); station_class->spec[i] = statspec; - statspec->allocated = true; } /** diff --git a/src/newgrf_station.h b/src/newgrf_station.h index b80584d8e..1c49dde18 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -48,11 +48,8 @@ typedef byte *StationLayout; /** Station specification. */ struct StationSpec { GRFFilePropsBase grf_prop; ///< Properties related the the grf file - - bool allocated; ///< Flag whether this station has been added to a station class list - - StationClassID cls_id; ///< The class to which this spec belongs. - StringID name; ///< Name of this station. + StationClassID cls_id; ///< The class to which this spec belongs. + StringID name; ///< Name of this station. /** * Bitmask of number of platforms available for the station. |