1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Kuhnovic da70210c90
Merge b8d966029c into 7eb042feac 2025-07-24 04:48:49 +00:00
translators 7eb042feac Update: Translations from eints
english (us): 5 changes by 2TallTyler
2025-07-24 04:46:38 +00:00
Koen Bussemaker b8d966029c Change: Allow building rail over bridges / tunnels and through stations / waypoints. 2025-05-25 14:52:31 +02:00
2 changed files with 30 additions and 10 deletions

View File

@ -634,8 +634,11 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Display
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Toggle graph of this cargo type
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_CAPTION :{WHITE}{INDUSTRY} - Cargo History
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produced
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transported
STR_GRAPH_INDUSTRY_RANGE_DELIVERED :Delivered
STR_GRAPH_INDUSTRY_RANGE_WAITING :Waiting
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Show detailed performance ratings
@ -4023,6 +4026,8 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production last minute:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transported)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Center the main view on industry location. Ctrl+Click to open a new viewport on industry location
STR_INDUSTRY_VIEW_CARGO_GRAPH :{BLACK}Cargo Graph
STR_INDUSTRY_VIEW_CARGO_GRAPH_TOOLTIP :{BLACK}Shows the graph of industry cargo history
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure!

View File

@ -884,11 +884,33 @@ static CommandCost CmdRailTrackHelper(DoCommandFlags flags, TileIndex tile, Tile
CommandCost ret = ValidateAutoDrag(&trackdir, tile, end_tile);
if (ret.Failed()) return ret;
int distance_remaining = static_cast<int>(DistanceManhattan(tile, end_tile)) + 1;
auto advance = [&] {
distance_remaining--;
tile = TileAddByDiagDir(tile, TrackdirToExitdir(trackdir));
trackdir = NextTrackdir(trackdir);
};
bool had_success = false;
CommandCost last_error = CMD_ERROR;
for (;;) {
ret = remove ? Command<CMD_REMOVE_SINGLE_RAIL>::Do(flags, tile, TrackdirToTrack(trackdir)) : Command<CMD_BUILD_SINGLE_RAIL>::Do(flags, tile, railtype, TrackdirToTrack(trackdir), auto_remove_signals);
if (!remove && !fail_on_obstacle && last_error.GetErrorMessage() == STR_ERROR_ALREADY_BUILT) had_success = true;
for (; distance_remaining > 0; advance()) {
if (!remove && !fail_on_obstacle && CheckTileOwnership(tile).Succeeded() && IsCompatibleRail(GetRailType(tile), railtype)) {
/* Skip stations and waypoints */
if (HasStationTileRail(tile) && GetRailStationTrack(tile) == track) continue;
/* Skip bridges and tunnels */
if (IsTileType(tile, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL
&& DiagDirToDiagTrackdir(GetTunnelBridgeDirection(tile)) == trackdir ) {
const uint length = GetTunnelBridgeLength(tile, GetOtherTunnelBridgeEnd(tile));
for (uint i = 0; i <= length; ++i) advance();
continue;
}
}
ret = remove ? Command<CMD_REMOVE_SINGLE_RAIL>::Do(flags, tile, TrackdirToTrack(trackdir))
: Command<CMD_BUILD_SINGLE_RAIL>::Do(flags, tile, railtype, TrackdirToTrack(trackdir), auto_remove_signals);
if (!remove && !fail_on_obstacle && ret.GetErrorMessage() == STR_ERROR_ALREADY_BUILT) had_success = true;
if (ret.Failed()) {
last_error = std::move(ret);
@ -903,13 +925,6 @@ static CommandCost CmdRailTrackHelper(DoCommandFlags flags, TileIndex tile, Tile
had_success = true;
total_cost.AddCost(ret.GetCost());
}
if (tile == end_tile) break;
tile += ToTileIndexDiff(_trackdelta[trackdir]);
/* toggle railbit for the non-diagonal tracks */
if (!IsDiagonalTrackdir(trackdir)) ToggleBit(trackdir, 0);
}
if (had_success) return total_cost;