# HG changeset patch # User rubidium # Date 1281455493 0 # Node ID 640ed6b3475cc27c23599af8d622ad3fe6a5948f # Parent 1f4837ccb325db6d0ae944e7a701c202adad118a (svn r20436) -Codechange: use GRFFilePropsBase's spritegroup for stations. diff --git a/src/newgrf.cpp b/src/newgrf.cpp --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3870,7 +3870,7 @@ continue; } - statspec->spritegroup[ctype] = _cur_grffile->spritegroups[groupid]; + statspec->grf_prop.spritegroup[ctype] = _cur_grffile->spritegroups[groupid]; } } @@ -3890,7 +3890,7 @@ continue; } - statspec->spritegroup[CT_DEFAULT] = _cur_grffile->spritegroups[groupid]; + statspec->grf_prop.spritegroup[CT_DEFAULT] = _cur_grffile->spritegroups[groupid]; statspec->grf_prop.grffile = _cur_grffile; statspec->grf_prop.local_id = stations[i]; StationClass::Assign(statspec); diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -550,7 +550,7 @@ /* Pick the first cargo that we have waiting */ const CargoSpec *cs; FOR_ALL_CARGOSPECS(cs) { - if (object->u.station.statspec->spritegroup[cs->Index()] != NULL && + if (object->u.station.statspec->grf_prop.spritegroup[cs->Index()] != NULL && !st->goods[cs->Index()].cargo.Empty()) { ctype = cs->Index(); break; @@ -558,10 +558,10 @@ } } - group = object->u.station.statspec->spritegroup[ctype]; + group = object->u.station.statspec->grf_prop.spritegroup[ctype]; if (group == NULL) { ctype = CT_DEFAULT; - group = object->u.station.statspec->spritegroup[ctype]; + group = object->u.station.statspec->grf_prop.spritegroup[ctype]; } if (group == NULL) return NULL; diff --git a/src/newgrf_station.h b/src/newgrf_station.h --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -47,7 +47,13 @@ /** Station specification. */ struct StationSpec { - GRFFilePropsBase<0> grf_prop; ///< Properties related the the grf file + /** + * Properties related the the grf file. + * NUM_CARGO real cargo plus three pseudo cargo sprite groups. + * Used for obtaining the sprite offset of custom sprites, and for + * evaluating callbacks. + */ + GRFFilePropsBase grf_prop; StationClassID cls_id; ///< The class to which this spec belongs. StringID name; ///< Name of this station. @@ -99,13 +105,6 @@ uint8 anim_status; uint8 anim_speed; uint16 anim_triggers; - - /** - * NUM_CARGO real cargo plus three pseudo cargo sprite groups. - * Used for obtaining the sprite offset of custom sprites, and for - * evaluating callbacks. - */ - const struct SpriteGroup *spritegroup[NUM_CARGO + 3]; }; /** Struct containing information relating to station classes. */