Changeset - r6039:5f9d9a7d34c9
[Not reviewed]
master
0 2 0
rubidium - 17 years ago 2007-02-16 22:44:56
rubidium@openttd.org
(svn r8765) -Codechange: remove logic redundancy by moving it from the gui into the cmd code.
2 files changed with 2 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/road_gui.cpp
Show inline comments
 
@@ -100,16 +100,6 @@ static void PlaceRoadStop(TileIndex tile
 
	if (p1 >= DIAGDIR_END) {
 
		SETBIT(p2, 1); // It's a drive-through stop
 
		p1 -= DIAGDIR_END; // Adjust picker result to actual direction
 

	
 
		/* Only allow building over a road if its a straight road,
 
		 * facing the right direction and it belongs to the player */
 
		if ((IsTileType(tile, MP_STREET) &&
 
				GetRoadTileType(tile) == ROAD_TILE_NORMAL &&
 
				(IsTileOwner(tile, _current_player) || (_patches.road_stop_on_town_road && IsTileOwner(tile, OWNER_TOWN))) &&
 
				!(GetRoadBits(tile) & ((DiagDirection)p1 == DIAGDIR_NE ? ROAD_Y : ROAD_X)))) {
 

	
 
			cmd ^= CMD_AUTO;
 
		}
 
	}
 
	DoCommandP(tile, p1, p2, CcRoadDepot, cmd);
 
}
src/station_cmd.cpp
Show inline comments
 
@@ -1276,6 +1276,8 @@ int32 CmdBuildRoadStop(TileIndex tile, u
 
	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile))
 
		return CMD_ERROR;
 

	
 
	if (build_over_road) flags ^= DC_AUTO;
 

	
 
	if (build_over_road && IsTileOwner(tile, OWNER_TOWN)) _current_player = OWNER_TOWN;
 
	ret = CheckFlatLandBelow(tile, 1, 1, flags, is_drive_through ? 5 << p1 : 1 << p1, NULL);
 
	_current_player = cur_owner;
0 comments (0 inline, 0 general)