Changeset - r24294:024c3061df55
[Not reviewed]
master
0 1 0
TrevorShelton - 4 years ago 2020-06-28 11:53:56
54145769+TrevorShelton@users.noreply.github.com
Fix #8221: Missing specific error message for bridge too long (#8240)
1 file changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/bridge_gui.cpp
Show inline comments
 
@@ -426,9 +426,12 @@ void ShowBuildBridgeWindow(TileIndex sta
 
			default: break;
 
		}
 

	
 
		bool any_available = false;
 
		CommandCost type_check;
 
		/* loop for all bridgetypes */
 
		for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) {
 
			if (CheckBridgeAvailability(brd_type, bridge_len).Succeeded()) {
 
			type_check = CheckBridgeAvailability(brd_type, bridge_len);
 
			if (type_check.Succeeded()) {
 
				/* bridge is accepted, add to list */
 
				/*C++17: BuildBridgeData &item = */ bl->emplace_back();
 
				BuildBridgeData &item = bl->back();
 
@@ -437,8 +440,14 @@ void ShowBuildBridgeWindow(TileIndex sta
 
				/* Add to terraforming & bulldozing costs the cost of the
 
				 * bridge itself (not computed with DC_QUERY_COST) */
 
				item.cost = ret.GetCost() + (((int64)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item.spec->price) >> 8) + infra_cost;
 
				any_available = true;
 
			}
 
		}
 
		/* give error cause if no bridges available here*/
 
		if (!any_available)
 
		{
 
			errmsg = type_check.GetErrorMessage();
 
		}
 
	}
 

	
 
	if (bl != nullptr && bl->size() != 0) {
0 comments (0 inline, 0 general)