summaryrefslogtreecommitdiff
path: root/roadveh_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 /roadveh_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 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 7bf29103f..7ef55f052 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -231,7 +231,7 @@ void ClearSlot(Vehicle *v, RoadStop *rs)
if (rs != NULL) {
// check that the slot is indeed assigned to the same vehicle
assert(rs->slot[v->u.road.slotindex] == v->index);
- rs->slot[v->u.road.slotindex] = INVALID_SLOT;
+ rs->slot[v->u.road.slotindex] = INVALID_VEHICLE;
}
}
@@ -1578,7 +1578,7 @@ void OnNewDay_RoadVeh(Vehicle *v)
DEBUG(ms, 2) ("Multistop: Attempting to obtain a slot for vehicle %d at station %d (0x%x)", v->unitnumber, st->index, st->xy);
for (; rs != NULL; rs = rs->next) {
// Only consider those with at least a free slot.
- if (!(rs->slot[0] == INVALID_SLOT || rs->slot[1] == INVALID_SLOT))
+ if (!(rs->slot[0] == INVALID_VEHICLE || rs->slot[1] == INVALID_VEHICLE))
continue;
// Previously the NPF pathfinder was used here even if NPF is OFF.. WTF?
@@ -1614,8 +1614,8 @@ void OnNewDay_RoadVeh(Vehicle *v)
if (best_stop != NULL) {
int slot;
// Find a free slot in this stop. We know that at least one is free.
- assert(best_stop->slot[0] == INVALID_SLOT || best_stop->slot[1] == INVALID_SLOT);
- slot = (best_stop->slot[0] == INVALID_SLOT) ? 0 : 1;
+ assert(best_stop->slot[0] == INVALID_VEHICLE || best_stop->slot[1] == INVALID_VEHICLE);
+ slot = (best_stop->slot[0] == INVALID_VEHICLE) ? 0 : 1;
best_stop->slot[slot] = v->index;
v->u.road.slot = best_stop;
v->dest_tile = best_stop->xy;