Changeset - r26511:63d7f0ee3979
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 2 years ago 2022-11-06 15:46:11
j.g.rennison@gmail.com
Fix #10011: Incorrect infrastructure totals when overbuilding bay road stop (#10143)

Fix https://github.com/OpenTTD/OpenTTD/issues/10011
1 file changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1910,18 +1910,15 @@ CommandCost CmdBuildRoadStop(DoCommandFl
 
				if (road_rt == INVALID_ROADTYPE && RoadTypeIsRoad(rt)) road_rt = rt;
 
				if (tram_rt == INVALID_ROADTYPE && RoadTypeIsTram(rt)) tram_rt = rt;
 

	
 
				UpdateCompanyRoadInfrastructure(road_rt, road_owner, ROAD_STOP_TRACKBIT_FACTOR);
 
				UpdateCompanyRoadInfrastructure(tram_rt, tram_owner, ROAD_STOP_TRACKBIT_FACTOR);
 

	
 
				MakeDriveThroughRoadStop(cur_tile, st->owner, road_owner, tram_owner, st->index, rs_type, road_rt, tram_rt, axis);
 
				road_stop->MakeDriveThrough();
 
			} else {
 
				if (road_rt == INVALID_ROADTYPE && RoadTypeIsRoad(rt)) road_rt = rt;
 
				if (tram_rt == INVALID_ROADTYPE && RoadTypeIsTram(rt)) tram_rt = rt;
 
				/* Non-drive-through stop never overbuild and always count as two road bits. */
 
				Company::Get(st->owner)->infrastructure.road[rt] += ROAD_STOP_TRACKBIT_FACTOR;
 
				MakeRoadStop(cur_tile, st->owner, st->index, rs_type, road_rt, tram_rt, ddir);
 
			}
 
			UpdateCompanyRoadInfrastructure(road_rt, road_owner, ROAD_STOP_TRACKBIT_FACTOR);
 
			UpdateCompanyRoadInfrastructure(tram_rt, tram_owner, ROAD_STOP_TRACKBIT_FACTOR);
 
			Company::Get(st->owner)->infrastructure.station++;
 

	
 
			MarkTileDirtyByTile(cur_tile);
0 comments (0 inline, 0 general)