From 6cfefdb2750d9beccb350ea47db9e2edaa61655c Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 18 Feb 2006 14:11:23 +0000 Subject: (svn r3612) - RoadStop->slot[] stores a vehicle index. Adjust its type and use INVALID_VEHICLE instead of nonsense INVALID_SLOT. --- roadveh_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'roadveh_cmd.c') 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; -- cgit v1.2.3-54-g00ecf