1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00
Commit Graph

31564 Commits

Author SHA1 Message Date
db1a1c5dd9 Change: Invalidate build toolbars when NewGRFs are changed.
If NewGRFs are changed while a rail or road toolbar is open, the toolbar could refer to an invalid rail/road type. If so, close it.
2024-10-31 09:10:01 +00:00
6d2b93d3b3 Codechange: Set up rail/road toolbar buttons during window's OnInit event.
This ensures the buttons are configured without extra initialisation methods.
2024-10-31 09:10:01 +00:00
0e3fdfb1b5 Codechange: Don't store pointer to RoadTypeInfo in road toolbar.
Always look up via stored RoadType instead. This matches out the rail toolbar behaves, and avoids keeping an non-owned pointer lying around.
2024-10-31 09:10:01 +00:00
552cf72b98 Codefix: Immediately return invalid rail/road type when looking for label 0. (#13045)
Looking for label 0 would incorrectly return the first undefined type instead of INVALID_RAIL/ROADTYPE, which could potentially cause incorrect behaviour.
2024-10-31 00:11:16 +00:00
Loïc Guilloux
9dae626237 Codefix: restore _generating_world and nearest town cache when failing to fund a random town (#13042) 2024-10-29 19:56:15 +01:00
Jonathan G Rennison
883be19865 Codefix a6f412c6: Missing this-> in YAPF 2024-10-29 19:07:14 +01:00
Jonathan G Rennison
07e8547eb5 Fix: Terraform of road waypoint tiles (#13040) 2024-10-29 14:08:15 +01:00
Koen Bussemaker
0200bc3720 Codechange: Renamed CHashTableT to HashTable and corrected code style 2024-10-29 08:35:47 +01:00
0e13a7d124 Fix 3f81124: Invalid data used for height map curves after first run. (#13039)
Static variable depended on other non-static variables.
2024-10-28 23:18:05 +00:00
SamuXarick
a96a83e330 Codechange: Code style issues in water regions (#13019) 2024-10-28 10:29:26 -04:00
translators
abd89b0748 Update: Translations from eints
german: 19 changes by Wuzzy2
2024-10-28 04:47:39 +00:00
e076aaf740 Codefix: Use SpriteID when passing sprite IDs. (#13037) 2024-10-27 18:54:49 +00:00
e1697a6ad1 Codechange: Don't use enums for non-enumerated values. (#13031)
In the past we have used enums to hold an arbitrary values. These values
are not enumerated types, so make them constants instead.
2024-10-27 18:02:49 +00:00
SamuXarick
a86f9dba0f Codefix: Correct handling of GetDepotOrderType() comparison (#13023)
In the function where we check the depot order type, using `!=` with GetDepotOrderType() is not ideal because the function can return flag bits.
2024-10-27 18:47:22 +01:00
9cf47e69d6 Fix bb8a0c7641: Skip control codes when sorting strings. (#13035)
Now that SkipGarbage doesn't skip all multi-byte utf-8 characters, string control codes are not skipped either. This gave unintended sorting when NewGRF names start with colour codes.

Make SkipGarbage UTF-8 aware so that it is able to skip some unicode ranges as well.
2024-10-27 15:49:09 +00:00
translators
233ee16c44 Update: Translations from eints
bulgarian: 18 changes by Alexandar83
2024-10-27 04:47:27 +00:00
bb8a0c7641 Fix: SkipGarbage() skipped all multi-byte utf-8 characters. (#13032)
`char` is signed so `str[0] < '0'` applies to all characters higher than 127.
2024-10-26 21:01:33 +01:00
1191efa581 Fix #12914: Fix use of invalidated pointer in viewport drawer. (#12918)
Use index of last child instead of pointer to update next_child element.

In case there is no child sprite yet, the most recent parent sprite's first_child is updated instead.
2024-10-26 15:24:41 +01:00
4f9c10d35f Codechange: Simplify storage of WaterTileType in map. (#13030) 2024-10-26 10:17:44 +01:00
e50c1774fc Codechange: Remove some unnecessary local variables. 2024-10-25 19:01:39 +01:00
c39554a210 Codechange: Simplify selection between pathfinder functions. 2024-10-25 19:01:39 +01:00
1403a55e5d Codechange: Use uppercase naming for YAPF cost constant. 2024-10-25 19:01:39 +01:00
a171939ec3 Codechange: Remove m_ prefix from pathfinders. 2024-10-25 19:01:39 +01:00
a496e9397c Codechange: Prefer member-initialization. 2024-10-25 19:01:39 +01:00
a6f412c615 Codechange: Add this-> to YAPF. 2024-10-25 19:01:39 +01:00
5b73654f94 Codechange: Add includes to YAPF .hpp files. 2024-10-25 19:01:39 +01:00
009e57ee03 Codechange: Use member initializer list. 2024-10-25 19:01:39 +01:00
Rubidium
ea6aa4653a Codechange: replace magic numbers with enumeration 2024-10-25 18:37:11 +02:00
Rubidium
4a4c77ff04 Codechange: use functions described in documentation, instead of related other functions 2024-10-25 18:37:11 +02:00
Jonathan G Rennison
8ed983b3cd Codechange: Re-order load update for SLV_139
It is no longer required to be performed before the first phase
of vehicle updates
2024-10-25 17:05:59 +02:00
Jonathan G Rennison
f19829d029 Fix #12831: Delay vehicle cache init to after map upgrades in load
Split AfterLoadVehicles into two functions.
Vehicle cache init and other functionality requiring an upgraded and
valid map is now performed later in the load process.
2024-10-25 17:05:59 +02:00
Rubidium
dfb74e25f7 Codechange: remove parameter which value can always be deduced 2024-10-24 22:02:50 +02:00
SamuXarick
d5a13fb9f4 Codechange: Use TileOffsByAxis(...) in more places (#13026) 2024-10-24 15:58:15 -04:00
Rubidium
c9819f8957 Codechange: split GetRoadDir as bays have DiagDir and drive throughs have Axis 2024-10-24 20:40:32 +02:00
Da-W1nn3r
d6aa09f96a Fix #12973: Don't exclude high score after using sandbox 2024-10-24 08:38:16 +02:00
Rubidium
ce641af6a9 Codechange: use StationGfx over RoadStopDir + optional offset for drive through stop 2024-10-23 18:19:32 +02:00
Rubidium
38c9eb76a0 Codechange: add and use TileOffsByAxis(...) over TileOffsByDir(DiagDirToAxis(...)) 2024-10-23 18:19:17 +02:00
7a71df2952 Codechange: Use fmt::format to convert value to binary string representation. (#13016)
Avoids manually iterating bits into an array.
2024-10-22 13:59:08 +01:00
translators
51ffb2a1a3 Update: Translations from eints
arabic (egypt): 3 changes by Alaadel
2024-10-22 04:47:27 +00:00
01807fa753 Change: Use Markdown for changelog.
Includes minor changes to how version changes are limited for display.
2024-10-22 00:34:16 +01:00
e98407973f Fix #12993: Replace known-bugs text with markdown version.
This allows a little bit better formatting/display in game.

(No attempt to check if these are still valid known-bugs...)
2024-10-22 00:34:16 +01:00
e3bfe2b668 Fix: Don't invalidate water regions on the other side of the map. (#13012)
When invalidating water regions with a tile at the very edge of the map, the region on the opposite side of the map would also be invalidated.
2024-10-22 00:33:29 +01:00
3eb7901ad9 Codechange: Use template parameter of SetBitIterator instead of casting later. (#13015)
This removes some manual casting.
2024-10-21 17:54:54 +01:00
Jonathan G Rennison
6ca9ddcffa Codefix: [Win32] String handling in OTTDStringCompare, Win32StringContains
Avoid truncation if CompareStringEx is missing
Fix handling of zero length inputs
2024-10-21 17:34:30 +02:00
Jonathan G Rennison
d7a2efd623 Codefix: [Win32] Truncated stack trace symbols were not null-terminated
SymGetSymFromAddr64/IMAGEHLP_SYMBOL64 do not null-terminate
symbols with lengths >= the name buffer size
2024-10-21 17:34:03 +02:00
Rubidium
18e8a34081 Codechange: replace "magic" trick with simpler straight forward code 2024-10-20 15:49:32 +02:00
Rubidium
392bcf5c9a Codechange: simplify ToTileIndexDiff by just calling TileDiffXY 2024-10-20 15:49:32 +02:00
Rubidium
1998e94ae7 Codechange: create the TileIndexDiff of the whole translation we want to execute 2024-10-20 15:49:32 +02:00
Rubidium
a6b7593a52 Codechange: use TileDiffXY(0, 0) over magic 0 2024-10-20 15:49:32 +02:00
Rubidium
3b0fcf442f Codefix: use actual type instead of int for TileIndexDiff 2024-10-20 15:49:32 +02:00