Changeset - r6687:aaacb8e424b1
[Not reviewed]
master
0 3 0
rubidium - 17 years ago 2007-05-25 11:01:44
rubidium@openttd.org
(svn r9919) -Codechange: prepare some more places for more road types.
3 files changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_gui.cpp
Show inline comments
 
@@ -157,12 +157,15 @@ static void GenerateReplaceVehList(Windo
 
			/* Skip drawing the engines we don't have any of and haven't set for replacement */
 
			if (num_engines == 0 && EngineReplacementForPlayer(GetPlayer(_local_player), e, selected_group) == INVALID_ENGINE) continue;
 
		} else {
 
			/* This is for engines we can replace to and they should depend on what we selected to replace from */
 
			if (!IsEngineBuildable(e, type, _local_player)) continue; // we need to be able to build the engine
 
			if (!EnginesGotCargoInCommon(e, WP(w, replaceveh_d).sel_engine[0])) continue; // the engines needs to be able to carry the same cargo
 

	
 
			/* Road vehicles can't be replaced by trams and vice-versa */
 
			if (type == VEH_ROAD && HASBIT(EngInfo(WP(w, replaceveh_d).sel_engine[0])->misc_flags, EF_ROAD_TRAM) != HASBIT(EngInfo(e)->misc_flags, EF_ROAD_TRAM)) continue;
 
			if (e == WP(w, replaceveh_d).sel_engine[0]) continue; // we can't replace an engine into itself (that would be autorenew)
 
		}
 

	
 
		EngList_Add(list, e);
 
		if (e == WP(w, replaceveh_d).sel_engine[i]) selected_engine = e; // The selected engine is still in the list
 
	}
src/roadveh_cmd.cpp
Show inline comments
 
@@ -954,12 +954,15 @@ static void RoadVehCheckOvertake(Vehicle
 
	if (u->max_speed >= v->max_speed &&
 
			!(u->vehstatus & VS_STOPPED) &&
 
			u->cur_speed != 0) {
 
		return;
 
	}
 

	
 
	/* Trams can't overtake other trams */
 
	if (v->u.road.roadtype == ROADTYPE_TRAM) return;
 

	
 
	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 >= RVSB_IN_ROAD_STOP || !IsStraightRoadTrackdir((Trackdir)(v->u.road.state & RVSB_TRACKDIR_MASK))) return;
 

	
 
	tt = GetTileTrackStatus(v->tile, TRANSPORT_ROAD, v->u.road.compatible_roadtypes) & 0x3F;
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -1045,23 +1045,25 @@ void DrawBridgeMiddle(const TileInfo* ti
 
		SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 
		pal = PALETTE_TO_TRANSPARENT;
 
	} else {
 
		pal = psid->pal;
 
	}
 

	
 
	if (GetRailType(rampsouth) == RAILTYPE_ELECTRIC) {
 
		DrawCatenary(ti);
 
	}
 

	
 
	/* draw roof, the component of the bridge which is logically between the vehicle and the camera */
 
	if (axis == AXIS_X) {
 
		y += 12;
 
		if (image & SPRITE_MASK) AddSortableSpriteToDraw(image, pal, x, y, 16, 1, 0x28, z);
 
	} else {
 
		x += 12;
 
		if (image & SPRITE_MASK) AddSortableSpriteToDraw(image, pal, x, y, 1, 16, 0x28, z);
 
	}
 

	
 
	if (GetRailType(rampsouth) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
 

	
 
	psid++;
 
	if (ti->z + 5 == z) {
 
		/* draw poles below for small bridges */
 
		if (psid->sprite != 0) {
 
			image = psid->sprite;
 
			if (HASBIT(_transparent_opt, TO_BRIDGES)) {
0 comments (0 inline, 0 general)