src/roadveh_cmd.cpp
branchcpp_gui
changeset 6268 4b5241e5dd10
parent 6254 abc6ad7c035c
child 6285 187e3ef04cc9
--- a/src/roadveh_cmd.cpp	Tue Feb 27 23:54:28 2007 +0000
+++ b/src/roadveh_cmd.cpp	Wed Feb 28 00:33:40 2007 +0000
@@ -880,7 +880,9 @@
 
 	// Clamp
 	spd = min(spd, v->max_speed);
-	if (v->u.road.state == RVSB_WORMHOLE) spd = min(spd, SetSpeedLimitOnBridge(v));
+	if (v->u.road.state == RVSB_WORMHOLE && !(v->vehstatus & VS_HIDDEN)) {
+		spd = min(spd, GetBridge(GetBridgeType(v->tile))->speed * 2);
+	}
 
 	//updates statusbar only if speed have changed to save CPU time
 	if (spd != v->cur_speed) {
@@ -972,7 +974,7 @@
 	if (v->direction != u->direction || !(v->direction & 1)) return;
 
 	/* Check if vehicle is in a road stop, depot, tunnel or bridge or not on a straight road */
-	if (v->u.road.state >= RVS_IN_ROAD_STOP || !IsStraightRoadTrackdir((Trackdir)(v->u.road.state & RVSB_TRACKDIR_MASK))) return;
+	if (v->u.road.state >= RVSB_IN_ROAD_STOP || !IsStraightRoadTrackdir((Trackdir)(v->u.road.state & RVSB_TRACKDIR_MASK))) return;
 
 	tt = GetTileTrackStatus(v->tile, TRANSPORT_ROAD) & 0x3F;
 	if ((tt & 3) == 0) return;
@@ -1355,9 +1357,7 @@
 
 	if (v->u.road.state == RVSB_WORMHOLE) {
 		/* Vehicle is entering a depot or is on a bridge or in a tunnel */
-		GetNewVehiclePosResult gp;
-
-		GetNewVehiclePos(v, &gp);
+		GetNewVehiclePosResult gp = GetNewVehiclePos(v);
 
 		const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
 		if (u != NULL && u->cur_speed < v->cur_speed) {