Changeset - r26265:1e0f269d60e8
[Not reviewed]
master
0 1 0
Tyler Trahan - 2 years ago 2022-05-11 23:59:57
tyler@tylertrahan.com
Fix #9870: Don't update infrastructure totals when overbuilding object on canal
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/water_cmd.cpp
Show inline comments
 
@@ -495,11 +495,14 @@ CommandCost CmdBuildCanal(DoCommandFlag 
 
					FALLTHROUGH;
 

	
 
				default:
 
					MakeCanal(current_tile, _current_company, Random());
 
					if (Company::IsValidID(_current_company)) {
 
					/* If we overbuild a water object with a canal, don't update the infrastructure total. */
 
					bool is_existing_canal = IsTileType(current_tile, MP_WATER) && IsCanal(current_tile);
 
					if (Company::IsValidID(_current_company) && !is_existing_canal) {
 
						Company::Get(_current_company)->infrastructure.water++;
 
						DirtyCompanyInfrastructureWindows(_current_company);
 
					}
 

	
 
					MakeCanal(current_tile, _current_company, Random());
 
					break;
 
			}
 
			MarkTileDirtyByTile(current_tile);
0 comments (0 inline, 0 general)