summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-02-18 14:11:23 +0000
committerpeter1138 <peter1138@openttd.org>2006-02-18 14:11:23 +0000
commit6cfefdb2750d9beccb350ea47db9e2edaa61655c (patch)
tree472160528d13b96f762e1c4fbef14b3176941371 /station_cmd.c
parent9ed8143264e5b7944bf2f6a8be3fafc359edd9bd (diff)
downloadopenttd-6cfefdb2750d9beccb350ea47db9e2edaa61655c.tar.xz
(svn r3612) - RoadStop->slot[] stores a vehicle index. Adjust its type and use INVALID_VEHICLE instead of nonsense INVALID_SLOT.
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 19bbe0769..9799878ba 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -88,7 +88,7 @@ static void InitializeRoadStop(RoadStop *road_stop, RoadStop *previous, TileInde
road_stop->xy = tile;
road_stop->used = true;
road_stop->status = 3; //stop is free
- road_stop->slot[0] = road_stop->slot[1] = INVALID_SLOT;
+ road_stop->slot[0] = road_stop->slot[1] = INVALID_VEHICLE;
road_stop->next = NULL;
road_stop->prev = previous;
road_stop->station = index;
@@ -1428,7 +1428,7 @@ static int32 RemoveRoadStop(Station *st, uint32 flags, TileIndex tile)
/* Clear all vehicles destined for this station */
for (i = 0; i != NUM_SLOTS; i++) {
- if (cur_stop->slot[i] != INVALID_SLOT) {
+ if (cur_stop->slot[i] != INVALID_VEHICLE) {
Vehicle *v = GetVehicle(cur_stop->slot[i]);
ClearSlot(v, v->u.road.slot);
}
@@ -2301,14 +2301,14 @@ static void CheckOrphanedSlots(const Station *st, RoadStopType rst)
for (rs = GetPrimaryRoadStop(st, rst); rs != NULL; rs = rs->next) {
for (k = 0; k < NUM_SLOTS; k++) {
- if (rs->slot[k] != INVALID_SLOT) {
+ if (rs->slot[k] != INVALID_VEHICLE) {
const Vehicle *v = GetVehicle(rs->slot[k]);
if (v->type != VEH_Road || v->u.road.slot != rs) {
DEBUG(ms, 0) (
"Multistop: Orphaned %s slot at 0x%X of station %d (don't panic)",
(rst == RS_BUS) ? "bus" : "truck", rs->xy, st->index);
- rs->slot[k] = INVALID_SLOT;
+ rs->slot[k] = INVALID_VEHICLE;
}
}
}