Changeset - r26193:4bc7915a2156
[Not reviewed]
master
0 2 0
Michael Lutz - 2 years ago 2022-03-20 11:05:31
michi@icosahedron.de
Fix #9837, 46bd2f1c: Road build with wrong half-tile ends.
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/road_cmd.cpp
Show inline comments
 
@@ -989,7 +989,8 @@ CommandCost CmdBuildLongRoad(DoCommandFl
 
	/* Swap direction, also the half-tile drag vars. */
 
	if (start_tile > end_tile || (start_tile == end_tile && start_half)) {
 
		dir = ReverseDiagDir(dir);
 
		std::swap(start_half, end_half);
 
		start_half = !start_half;
 
		end_half = !end_half;
 
		if (drd == DRD_NORTHBOUND || drd == DRD_SOUTHBOUND) drd ^= DRD_BOTH;
 
	}
 

	
src/road_gui.cpp
Show inline comments
 
@@ -638,14 +638,14 @@ struct BuildRoadToolbarWindow : Window {
 
				case DDSP_PLACE_ROAD_X_DIR:
 
				case DDSP_PLACE_ROAD_Y_DIR:
 
				case DDSP_PLACE_AUTOROAD: {
 
					bool start_half = _place_road_dir == AXIS_Y ? _place_road_start_half_y : _place_road_start_half_y;
 
					bool start_half = _place_road_dir == AXIS_Y ? _place_road_start_half_y : _place_road_start_half_x;
 

	
 
					if (_remove_button_clicked) {
 
						Command<CMD_REMOVE_LONG_ROAD>::Post(this->rti->strings.err_remove_road, CcPlaySound_CONSTRUCTION_OTHER,
 
								start_tile, end_tile, _cur_roadtype, _place_road_dir, start_half, _place_road_end_half);
 
					} else {
 
						Command<CMD_BUILD_LONG_ROAD>::Post(this->rti->strings.err_build_road, CcPlaySound_CONSTRUCTION_OTHER,
 
								start_tile, end_tile, _cur_roadtype, _place_road_dir, _one_way_button_clicked ? DRD_NORTHBOUND : DRD_NONE, start_tile, _place_road_end_half, false);
 
								start_tile, end_tile, _cur_roadtype, _place_road_dir, _one_way_button_clicked ? DRD_NORTHBOUND : DRD_NONE, start_half, _place_road_end_half, false);
 
					}
 
					break;
 
				}
0 comments (0 inline, 0 general)