192 if (HasTileRoadType(tile, ROADTYPE_TRAM) != HasBit(EngInfo(p1)->misc_flags, EF_ROAD_TRAM)) return_cmd_error(STR_DEPOT_WRONG_DEPOT_TYPE); |
192 if (HasTileRoadType(tile, ROADTYPE_TRAM) != HasBit(EngInfo(p1)->misc_flags, EF_ROAD_TRAM)) return_cmd_error(STR_DEPOT_WRONG_DEPOT_TYPE); |
193 |
193 |
194 uint num_vehicles = 1 + CountArticulatedParts(p1, false); |
194 uint num_vehicles = 1 + CountArticulatedParts(p1, false); |
195 |
195 |
196 /* Allow for the front and the articulated parts, plus one to "terminate" the list. */ |
196 /* Allow for the front and the articulated parts, plus one to "terminate" the list. */ |
197 Vehicle **vl = (Vehicle**)alloca(sizeof(*vl) * (num_vehicles + 1)); |
197 Vehicle **vl = AllocaM(Vehicle*, num_vehicles + 1); |
198 memset(vl, 0, sizeof(*vl) * (num_vehicles + 1)); |
198 memset(vl, 0, sizeof(*vl) * (num_vehicles + 1)); |
199 |
199 |
200 if (!Vehicle::AllocateList(vl, num_vehicles)) { |
200 if (!Vehicle::AllocateList(vl, num_vehicles)) { |
201 return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); |
201 return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); |
202 } |
202 } |
1712 * a through route, do not stop) */ |
1712 * a through route, do not stop) */ |
1713 if (IsRoadVehFront(v) && ((IsInsideMM(v->u.road.state, RVSB_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END) && |
1713 if (IsRoadVehFront(v) && ((IsInsideMM(v->u.road.state, RVSB_IN_ROAD_STOP, RVSB_IN_ROAD_STOP_END) && |
1714 _road_veh_data_1[v->u.road.state - RVSB_IN_ROAD_STOP + (_settings_game.vehicle.road_side << RVS_DRIVE_SIDE)] == v->u.road.frame) || |
1714 _road_veh_data_1[v->u.road.state - RVSB_IN_ROAD_STOP + (_settings_game.vehicle.road_side << RVS_DRIVE_SIDE)] == v->u.road.frame) || |
1715 (IsInsideMM(v->u.road.state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END) && |
1715 (IsInsideMM(v->u.road.state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END) && |
1716 v->current_order.ShouldStopAtStation(v, GetStationIndex(v->tile)) && |
1716 v->current_order.ShouldStopAtStation(v, GetStationIndex(v->tile)) && |
|
1717 v->owner == GetRoadOwner(v->tile, v->u.road.roadtype) && |
1717 GetRoadStopType(v->tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK) && |
1718 GetRoadStopType(v->tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK) && |
1718 v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) { |
1719 v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) { |
1719 |
1720 |
1720 RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile)); |
1721 RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile)); |
1721 Station* st = GetStationByTile(v->tile); |
1722 Station* st = GetStationByTile(v->tile); |