Changeset - r24021:4da23ee44be4
[Not reviewed]
master
0 1 0
Charles Pigott - 4 years ago 2019-12-31 12:43:18
charlespigott@googlemail.com
Fix #6667: Also recalculate bridge costs for 'spectated' AI companies
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -551,12 +551,12 @@ CommandCost CmdBuildBridge(TileIndex end
 
		YapfNotifyTrackLayoutChange(tile_start, track);
 
	}
 

	
 
	/* for human player that builds the bridge he gets a selection to choose from bridges (DC_QUERY_COST)
 
	 * It's unnecessary to execute this command every time for every bridge. So it is done only
 
	 * and cost is computed in "bridge_gui.c". For AI, Towns this has to be of course calculated
 
	 */
 
	/* Human players that build bridges get a selection to choose from (DC_QUERY_COST)
 
	 * It's unnecessary to execute this command every time for every bridge.
 
	 * So it is done only for humans and cost is computed in bridge_gui.cpp.
 
	 * For (non-spectated) AI, Towns this has to be of course calculated. */
 
	Company *c = Company::GetIfValid(company);
 
	if (!(flags & DC_QUERY_COST) || (c != nullptr && c->is_ai)) {
 
	if (!(flags & DC_QUERY_COST) || (c != nullptr && c->is_ai && company != _local_company)) {
 
		bridge_len += 2; // begin and end tiles/ramps
 

	
 
		switch (transport_type) {
0 comments (0 inline, 0 general)