src/roadveh_cmd.cpp
branchNewGRF_ports
changeset 10994 cd9968b6f96b
parent 10991 d8811e327d12
--- a/src/roadveh_cmd.cpp	Tue Jun 17 10:32:49 2008 +0000
+++ b/src/roadveh_cmd.cpp	Tue Jun 17 13:22:13 2008 +0000
@@ -194,7 +194,7 @@
 	uint num_vehicles = 1 + CountArticulatedParts(p1, false);
 
 	/* Allow for the front and the articulated parts, plus one to "terminate" the list. */
-	Vehicle **vl = (Vehicle**)alloca(sizeof(*vl) * (num_vehicles + 1));
+	Vehicle **vl = AllocaM(Vehicle*, num_vehicles + 1);
 	memset(vl, 0, sizeof(*vl) * (num_vehicles + 1));
 
 	if (!Vehicle::AllocateList(vl, num_vehicles)) {
@@ -1714,6 +1714,7 @@
 			_road_veh_data_1[v->u.road.state - RVSB_IN_ROAD_STOP + (_settings_game.vehicle.road_side << RVS_DRIVE_SIDE)] == v->u.road.frame) ||
 			(IsInsideMM(v->u.road.state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END) &&
 			v->current_order.ShouldStopAtStation(v, GetStationIndex(v->tile)) &&
+			v->owner == GetRoadOwner(v->tile, v->u.road.roadtype) &&
 			GetRoadStopType(v->tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK) &&
 			v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) {