1
0
Fork 0

Compare commits

...

4 Commits

Author SHA1 Message Date
SamuXarick 1da3eb1c69
Merge f9aef24325 into 13759e9f23 2025-07-25 07:41:58 +00:00
Peter Nelson 13759e9f23
Fix: Display GRFID in correct hex format. (#14478) 2025-07-25 08:41:48 +01:00
translators 3e06c69e26 Update: Translations from eints
portuguese: 1 change by jcteotonio
polish: 6 changes by pAter-exe
2025-07-25 04:47:26 +00:00
SamuXarick f9aef24325 Fix: Remove unwanted river artifacts after generation
This requires postponing ModifyDesertZoneAroundRiver to after river generation.
2025-04-24 12:26:28 +01:00
6 changed files with 54 additions and 9 deletions

View File

@ -1026,7 +1026,8 @@ static void MakeLake(TileIndex tile, uint height_lake)
for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
TileIndex t = tile + TileOffsByDiagDir(d);
if (IsWaterTile(t)) {
MakeRiverAndModifyDesertZoneAround(tile);
MakeRiver(tile, Random());
MarkTileDirtyByTile(tile);
return;
}
}
@ -1156,7 +1157,8 @@ static void RiverMakeWider(TileIndex tile, TileIndex origin_tile)
/* If the tile upstream isn't flat, don't bother. */
if (GetTileSlope(downstream_tile) != SLOPE_FLAT) return;
MakeRiverAndModifyDesertZoneAround(downstream_tile);
MakeRiver(downstream_tile, Random());
MarkTileDirtyByTile(downstream_tile);
}
/* If upstream is dry and flat, try making it a river tile. */
@ -1164,13 +1166,15 @@ static void RiverMakeWider(TileIndex tile, TileIndex origin_tile)
/* If the tile upstream isn't flat, don't bother. */
if (GetTileSlope(upstream_tile) != SLOPE_FLAT) return;
MakeRiverAndModifyDesertZoneAround(upstream_tile);
MakeRiver(upstream_tile, Random());
MarkTileDirtyByTile(upstream_tile);
}
}
/* If the tile slope matches the desired slope, add a river tile. */
if (cur_slope == desired_slope) {
MakeRiverAndModifyDesertZoneAround(tile);
MakeRiver(tile, Random());
MarkTileDirtyByTile(tile);
}
}
@ -1240,7 +1244,8 @@ protected:
for (PathNode *path = current.parent; path != nullptr; path = path->parent) {
TileIndex tile = path->GetTile();
if (!IsWaterTile(tile)) {
MakeRiverAndModifyDesertZoneAround(tile);
MakeRiver(tile, Random());
MarkTileDirtyByTile(tile);
}
}
@ -1358,7 +1363,8 @@ static std::tuple<bool, bool> FlowRiver(TileIndex spring, TileIndex begin, uint
/* We only want a lake if the river is long enough. */
DistanceManhattan(spring, lake_centre) > min_river_length) {
end = lake_centre;
MakeRiverAndModifyDesertZoneAround(lake_centre);
MakeRiver(lake_centre, Random());
MarkTileDirtyByTile(lake_centre);
uint diameter = RandomRange(8) + 3;
/* Run the loop twice, so artefacts from going circular in one direction get (mostly) hidden. */
@ -1422,6 +1428,25 @@ static void CreateRivers()
/* Widening rivers may have left some tiles requiring to be watered. */
ConvertGroundTilesIntoWaterTiles();
/* Search for unwanted pockets of river artifacts to clear them of water. */
for (const auto tile : Map::Iterate()) {
if (!IsTileType(tile, MP_WATER) || !IsRiver(tile)) continue;
bool has_neighbour = false;
for (DiagDirection d = DIAGDIR_BEGIN; d != DIAGDIR_END; d++) {
TileIndex other_tile = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(d));
if (other_tile == INVALID_TILE || !IsWaterTile(other_tile)) continue;
has_neighbour = true;
if (_settings_game.game_creation.landscape == LandscapeType::Tropic) ModifyDesertZoneAroundRiver(tile);
break;
}
if (!has_neighbour) {
DoClearSquare(tile);
}
}
/* Run tile loop to update the ground density. */
for (uint i = 0; i != TILE_UPDATE_FREQUENCY; i++) {
if (i % 64 == 0) IncreaseGeneratingWorldProgress(GWP_RIVER);

View File

@ -1010,11 +1010,14 @@ STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLA
STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Żaden
STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Wyświetl wszystkie ładunki na wykresie stawek za ładunek
STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Ukryj wszystkie ładunki na wykresie stawek za ładunek
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Przełącz ukrywanie/wyświetlanie wykresu danego typu ładunku
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Przełącz ukrywanie/wyświetlanie wykresu ładunku danego typu
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_CAPTION :{WHITE}{INDUSTRY} - Historia Ładunków
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Wyprodukowano
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Przetransportowano
STR_GRAPH_INDUSTRY_RANGE_DELIVERED :Dostarczono
STR_GRAPH_INDUSTRY_RANGE_WAITING :Oczekujący
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Pokaż szczegóły oceny wydajności
@ -4403,6 +4406,8 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Wyproduk
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Wyprodukowano w poprzedniej minucie:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% przetransportowano)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Wyśrodkuj widok główny na lokalizacji przedsiębiorstwa. Użyj Ctrl, aby otworzyć nowy podgląd na jego lokalizację
STR_INDUSTRY_VIEW_CARGO_GRAPH :{BLACK}Wykres Produkcji
STR_INDUSTRY_VIEW_CARGO_GRAPH_TOOLTIP :{BLACK}Wyświetl na wykresie historię stanu ładunków w tym przedsiębiorstwie
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Poziom produkcji: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Przedsiębiorstwo ogłosiło likwidację!

View File

@ -20,7 +20,7 @@
##id 0x0000
STR_NULL :
STR_EMPTY :
STR_UNDEFINED :(frase indefinida)
STR_UNDEFINED :(cadeia de caracteres indefinida)
STR_JUST_NOTHING :Nada
# Cargo related strings

View File

@ -59,7 +59,7 @@ static ChangeInfoResult LoadTranslationTable(uint first, uint last, ByteReader &
GRFFile *grf_override = GetCurrentGRFOverride();
if (grf_override != nullptr) {
/* GRF override is present, copy the translation table to the overridden GRF as well. */
GrfMsg(1, "LoadTranslationTable: Copying {} translation table to override GRFID '{}'", name, std::byteswap(grf_override->grfid));
GrfMsg(1, "LoadTranslationTable: Copying {} translation table to override GRFID {:08X}", name, std::byteswap(grf_override->grfid));
std::vector<T> &override_table = gettable(*grf_override);
override_table = translation_table;
}

View File

@ -39,6 +39,7 @@ void MakeWaterKeepingClass(TileIndex tile, Owner o);
void CheckForDockingTile(TileIndex t);
void MakeRiverAndModifyDesertZoneAround(TileIndex tile);
void ModifyDesertZoneAroundRiver(TileIndex tile);
static const uint RIVER_OFFSET_DESERT_DISTANCE = 5; ///< Circular tile search diameter to create non-desert around a river tile.
bool IsWateredTile(TileIndex tile, Direction from);

View File

@ -454,6 +454,20 @@ void MakeRiverAndModifyDesertZoneAround(TileIndex tile)
}
}
/**
* Remove desert directly around a river tile.
* @param tile The tile to create non-desert around
*/
void ModifyDesertZoneAroundRiver(TileIndex tile)
{
assert(IsTileType(tile, MP_WATER) && IsRiver(tile));
/* Remove desert directly around the river tile. */
for (auto t : SpiralTileSequence(tile, RIVER_OFFSET_DESERT_DISTANCE)) {
if (GetTropicZone(t) == TROPICZONE_DESERT) SetTropicZone(t, TROPICZONE_NORMAL);
}
}
/**
* Build a piece of canal.
* @param flags type of operation