(svn r16860) -Codechange: introduce a helper to assign a station spec to Waypoints

This commit is contained in:
rubidium
2009-07-17 20:21:24 +00:00
parent 46d94fdfed
commit 0e6b735b45
4 changed files with 23 additions and 26 deletions

View File

@@ -997,21 +997,8 @@ bool AfterLoadGame()
FOR_ALL_WAYPOINTS(wp) {
if (wp->delete_ctr == 0) {
const StationSpec *statspec = NULL;
if (HasBit(_m[wp->xy].m3, 4)) {
statspec = GetCustomStationSpec(STAT_CLASS_WAYP, _m[wp->xy].m4 + 1);
}
if (statspec != NULL) {
wp->spec.spec = statspec;
wp->spec.grfid = statspec->grffile->grfid;
wp->spec.localidx = statspec->localidx;
} else {
/* No custom graphics set, so set to default. */
wp->spec.spec = NULL;
wp->spec.grfid = 0;
wp->spec.localidx = 0;
wp->AssignStationSpec(_m[wp->xy].m4 + 1);
}
/* Move ground type bits from m2 to m4. */