(svn r9601) -Codechange: Store grf file reference in station spec, not just GRF ID

This commit is contained in:
peter1138
2007-04-11 21:04:03 +00:00
parent f7a92a2f16
commit 3148fdca59
5 changed files with 9 additions and 7 deletions

View File

@@ -22,6 +22,7 @@
#include "vehicle.h"
#include "yapf/yapf.h"
#include "date.h"
#include "newgrf.h"
enum {
MAX_WAYPOINTS_PER_TOWN = 64,
@@ -181,7 +182,7 @@ void AfterLoadWaypoints()
for (i = 0; i < GetNumCustomStations(STAT_CLASS_WAYP); i++) {
const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, i);
if (statspec != NULL && statspec->grfid == wp->grfid && statspec->localidx == wp->localidx) {
if (statspec != NULL && statspec->grffile->grfid == wp->grfid && statspec->localidx == wp->localidx) {
wp->stat_id = i;
break;
}
@@ -250,7 +251,7 @@ int32 CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (statspec != NULL) {
wp->stat_id = p1;
wp->grfid = statspec->grfid;
wp->grfid = statspec->grffile->grfid;
wp->localidx = statspec->localidx;
} else {
/* Specified custom graphics do not exist, so use default. */