Changeset - r23944:7c741ef1a615
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 5 years ago 2019-12-08 12:16:11
j.g.rennison@gmail.com
Fix: Infrastructure total update when removing tram road stop

The wrong road owner was used when updating the tram infrastructure total.
This could result in desyncs, negative infrastructure totals, etc.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -2123,13 +2123,13 @@ CommandCost CmdRemoveRoadStop(TileIndex 
 
			MakeRoadNormal(cur_tile, road_bits, road_type[RTT_ROAD], road_type[RTT_TRAM], ClosestTownFromTile(cur_tile, UINT_MAX)->index,
 
					road_owner[RTT_ROAD], road_owner[RTT_TRAM]);
 

	
 
			/* Update company infrastructure counts. */
 
			int count = CountBits(road_bits);
 
			UpdateCompanyRoadInfrastructure(road_type[RTT_ROAD], road_owner[RTT_ROAD], count);
 
			UpdateCompanyRoadInfrastructure(road_type[RTT_TRAM], road_owner[RTT_ROAD], count);
 
			UpdateCompanyRoadInfrastructure(road_type[RTT_TRAM], road_owner[RTT_TRAM], count);
 
		}
 
	}
 

	
 
	return had_success ? cost : last_error;
 
}
 

	
0 comments (0 inline, 0 general)