summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-01-17 21:14:17 +0000
committertron <tron@openttd.org>2007-01-17 21:14:17 +0000
commit4ff9b8a2a70ac27795721a662b3a5a5949cfe4a1 (patch)
treeaf04f21cea303100c3a5905accfde29ee18ee33a
parent6b93e14ade948e12483166147c5b300884890240 (diff)
downloadopenttd-4ff9b8a2a70ac27795721a662b3a5a5949cfe4a1.tar.xz
(svn r8207) -Fix
Remove the write-only attribute RoadStop::station
-rw-r--r--src/oldloader.cpp6
-rw-r--r--src/station.cpp8
-rw-r--r--src/station.h3
-rw-r--r--src/station_cmd.cpp11
4 files changed, 11 insertions, 17 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index d2e67a1b5..50dbeeea0 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -314,10 +314,8 @@ static void FixOldStations(void)
}
/* Check if there is a bus or truck station, and convert to new format */
- if (st->bus_tile_obsolete != 0) st->bus_stops = new RoadStop(st->bus_tile_obsolete, st->index);
-
- if (st->lorry_tile_obsolete != 0) st->truck_stops = new RoadStop(st->lorry_tile_obsolete, st->index);
-
+ if (st->bus_tile_obsolete != 0) st->bus_stops = new RoadStop(st->bus_tile_obsolete);
+ if (st->lorry_tile_obsolete != 0) st->truck_stops = new RoadStop(st->lorry_tile_obsolete);
}
}
diff --git a/src/station.cpp b/src/station.cpp
index 2330df237..d3eff6bb1 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -348,16 +348,15 @@ void RoadStop::operator delete(void *p, int index)
}
/** Initializes a RoadStop */
-RoadStop::RoadStop(TileIndex tile, StationID index) :
+RoadStop::RoadStop(TileIndex tile) :
xy(tile),
used(true),
status(3), // stop is free
num_vehicles(0),
- station(index),
next(NULL),
prev(NULL)
{
- DEBUG(ms, cDebugCtorLevel, "I+%3d at %d[0x%x]", index, tile, tile);
+ DEBUG(ms, cDebugCtorLevel, "I+ at %d[0x%x]", tile, tile);
}
/** De-Initializes a RoadStops. This includes clearing all slots that vehicles might
@@ -379,10 +378,9 @@ RoadStop::~RoadStop()
if (next != NULL) next->prev = prev;
used = false;
- DEBUG(ms, cDebugCtorLevel , "I-%3d at %d[0x%x]", station, xy, xy);
+ DEBUG(ms, cDebugCtorLevel , "I- at %d[0x%x]", xy, xy);
xy = INVALID_TILE;
- station = INVALID_STATION;
}
diff --git a/src/station.h b/src/station.h
index d7f6246f6..7d0ec21fa 100644
--- a/src/station.h
+++ b/src/station.h
@@ -50,13 +50,12 @@ typedef struct RoadStop {
byte status;
RoadStopID index;
byte num_vehicles;
- StationID station;
struct RoadStop *next;
struct RoadStop *prev;
static const int cDebugCtorLevel = 3;
- RoadStop(TileIndex tile, StationID index);
+ RoadStop(TileIndex tile);
~RoadStop();
void *operator new (size_t size);
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index e3598ba55..1d0f2befb 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1361,7 +1361,7 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
}
//give us a road stop in the list, and check if something went wrong
- road_stop = new RoadStop(tile, INVALID_STATION);
+ road_stop = new RoadStop(tile);
if (road_stop == NULL) {
return_cmd_error(type ? STR_3008B_TOO_MANY_TRUCK_STOPS : STR_3008A_TOO_MANY_BUS_STOPS);
}
@@ -1412,7 +1412,6 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
//initialize an empty station
road_stop->prev = prev;
- road_stop->station = st->index;
if (!st->facilities) st->xy = tile;
st->facilities |= (type) ? FACIL_TRUCK_STOP : FACIL_BUS_STOP;
st->owner = _current_player;
@@ -2852,7 +2851,7 @@ static const SaveLoad _roadstop_desc[] = {
SLE_VAR(RoadStop,status, SLE_UINT8),
/* Index was saved in some versions, but this is not needed */
SLE_CONDNULL(4, 0, 8),
- SLE_VAR(RoadStop,station, SLE_UINT16),
+ SLE_CONDNULL(2, 0, 44),
SLE_CONDNULL(1, 0, 25),
SLE_REF(RoadStop,next, REF_ROADSTOPS),
@@ -3007,13 +3006,13 @@ static void Load_STNS(void)
* convert, if needed */
if (CheckSavegameVersion(6)) {
if (st->bus_tile_obsolete != 0) {
- st->bus_stops = new RoadStop(st->bus_tile_obsolete, st->index);
+ st->bus_stops = new RoadStop(st->bus_tile_obsolete);
if (st->bus_stops == NULL)
error("Station: too many busstations in savegame");
}
if (st->lorry_tile_obsolete != 0) {
- st->truck_stops = new RoadStop(st->lorry_tile_obsolete, st->index);
+ st->truck_stops = new RoadStop(st->lorry_tile_obsolete);
if (st->truck_stops == NULL)
error("Station: too many truckstations in savegame");
@@ -3040,7 +3039,7 @@ static void Load_ROADSTOP(void)
int index;
while ((index = SlIterateArray()) != -1) {
- RoadStop *rs = new (index) RoadStop(INVALID_TILE, INVALID_STATION);
+ RoadStop *rs = new (index) RoadStop(INVALID_TILE);
SlObject(rs, _roadstop_desc);
}