Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
696 commits
Select commit Hold shift + click to select a range
3c80f2d
Update: Translations from eints
Jan 19, 2023
01be423
Fix #10362: NewGRF bridges without speed limits.
FLHerne Jan 16, 2023
5eb2e0f
Update: Translations from eints
Jan 20, 2023
3b0b572
Change: Log AI/GS Squirrel crashes in white text for readability (#10…
andythenorth Jan 20, 2023
953445a
Codechange: use MakeSea/AllocateMap in the oldloader instead of MemSetT
rubidium42 Jan 21, 2023
22d3de8
Codechange: use ScriptMap size functions instead of global functions
rubidium42 Jan 21, 2023
9c1a3b1
Codechange: use MapLogY() instead of FindFirstBit(MapSizeY()), MapSiz…
rubidium42 Jan 21, 2023
d481f78
Codechange: add map size related functions to Map structure
rubidium42 Jan 21, 2023
fe2bcd2
Codechange: migrate size related functions to Map structure
rubidium42 Jan 21, 2023
de6bc8e
Codechange: move TILE_MASK to Map::WrapToMap
rubidium42 Jan 21, 2023
7cdc23f
Codechange: hide the map's size related fields in the Map structure
rubidium42 Jan 21, 2023
8b5fa2c
Update: Translations from eints
Jan 21, 2023
b2a5ebc
Fix 3c047b1: AIGroup.GetProfitLastYear could get values different tha…
SamuXarick Jan 22, 2023
7d502e2
Update: Translations from eints
Jan 22, 2023
8aeef66
Fix #10377, Fix 94167df: bad sorting of rail vehicles when primary va…
rubidium42 Jan 19, 2023
9c5de7f
Fix #10395: When loading old saves, don't forcibly bar level crossing…
2TallTyler Jan 23, 2023
97844df
Update: Translations from eints
Jan 23, 2023
4dfd6a0
Fix #10220: Don't select unselectable engine as default. (#10404)
PeterN Jan 24, 2023
01a2449
Update: Translations from eints
Jan 24, 2023
2d0c1ff
Change #10255: Reduce basic thickness of linkgraph GUI lines (#10410)
merni-ns Jan 25, 2023
042f90a
Fix: no ScriptEvent sub class should export constructors to scripts
rubidium42 Jan 25, 2023
41fa94b
Fix: scripts cannot call constructors of ScriptEvents, so remove from…
rubidium42 Jan 25, 2023
3112b38
Fix: warnings about obsolete settings/setting values in Doxygen confi…
rubidium42 Jan 25, 2023
f9a473b
Fix: missing/duplicate documentation tags for scripts
rubidium42 Jan 25, 2023
2fd9946
Fix: scripts are not aware of nullptr, they only know null
rubidium42 Jan 25, 2023
0794072
Update: Translations from eints
Jan 26, 2023
eedb786
Codechange: Use vector for NewGRF spec overrides.
PeterN Jan 21, 2023
bcc53c5
Codechange: Add missing `this->` in override manager.
PeterN Jan 22, 2023
ede1201
Codechange: Rename override manager variables.
PeterN Jan 22, 2023
46dc6da
Codechange: Make void tiles flood edge tiles, instead of edge tiles f…
SamuXarick Jan 26, 2023
0b2567d
Codechange: Remove shift as fast-forward key when _DEBUG is defined
Nov 16, 2022
ae422be
Cleanup: remove/replace trailing ; with . in comments
rubidium42 Jan 26, 2023
5863d78
Codechange: use commented out code, or guard by #ifdef
rubidium42 Jan 26, 2023
71b46db
Cleanup: remove commented out code
rubidium42 Jan 26, 2023
755e41d
Codechange: make rounding code clearer
rubidium42 Jan 26, 2023
0072178
Fix: wrong type for INVALID_LINK_GRAPH_JOB
rubidium42 Jan 26, 2023
7e1d272
Cleanup: remove unused static variables
rubidium42 Jan 26, 2023
dbc6669
Update: Translations from eints
Jan 27, 2023
ed76859
Codechange: pass large objects by reference instead of value
rubidium42 Jan 28, 2023
d51d08d
Codechange: put stack variables in global variables for gamelog/crashlog
rubidium42 Jan 27, 2023
04d10b3
Codechange: instead of global pointer to stack variable, just put var…
rubidium42 Jan 28, 2023
4a58d19
Update: Translations from eints
Jan 28, 2023
df89c34
Fix 7e1e275: Measure AI Collect Garbage performance (#9924)
SamuXarick Jan 28, 2023
b7a5d8e
Codechange: add annotation to selectively force inlining in debug build
rubidium42 Jan 24, 2023
f001e84
Codechange: use RAII to automatically restore _cur_dpi after use
rubidium42 Jan 26, 2023
9fd88af
Remove: [Actions] Ubuntu/Debian release binaries (instead, use the Ge…
TrueBrain Jan 28, 2023
425ba82
Change: [Actions] split GitHub workflows into several smaller ones
TrueBrain Jan 28, 2023
146bd74
Change: [Actions] release Windows Store files to CDN
TrueBrain Jan 28, 2023
be0d65d
Add: [Actions] upload releases to GOG automatically
TrueBrain Jan 28, 2023
1951af0
Codechange: do not hide parameters with local variables
rubidium42 Jan 28, 2023
6ba55e6
Codechange: do not hide variables with other variables
rubidium42 Jan 28, 2023
8be908c
Fix #10430, Fix 6ba55e6: display chain window causing assert
rubidium42 Jan 29, 2023
5a4f049
Update: Translations from eints
Jan 29, 2023
4e65ec1
Codechange: do not declare functions in blocks
rubidium42 Jan 29, 2023
b82bcac
Fix #10419: Water infrastructure accounting when building ship depots
JGRennison Jan 29, 2023
9c915f0
Fix: Water infrastructure accounting when building docks
JGRennison Jan 29, 2023
07b40c0
Fix #10361, fe30f66: Don't try to give saved data to a dead script (#…
glx22 Jan 29, 2023
43657cf
Update: Translations from eints
Jan 30, 2023
f5394ed
Change: [NewGRF] Extend the D8xx (DCxx) string area up to FFFF.
michicc Jan 22, 2023
2d73076
Add: [NewGRF] Second vehicle property for additional callback flags.
michicc Jan 22, 2023
05ed9f5
Feature: [NewGRF] Engine name callback.
michicc Jan 22, 2023
1897e98
Update: Translations from eints
Jan 31, 2023
67e1d1a
Fix: no need to cast enums down to int32; they will be automatically …
rubidium42 Jan 31, 2023
3186950
Fix: make script goals work with the whole range of ClientIDs
rubidium42 Jan 31, 2023
12f9fbc
Fix: [CMake] remove cpack warning on fedora when lsb_release exists (…
bc-lee Feb 1, 2023
654a77c
Update: Translations from eints
Feb 1, 2023
184ff92
Cleanup: [Script] Pass new_rating directly to CmdTownRating (#10441)
SamuXarick Feb 1, 2023
4fc4874
Add: [Script] Let random road layout be a choice
SamuXarick Feb 1, 2023
d0639cd
Fix: [Script] Incorrect subsidy SourceID value used
SamuXarick Feb 1, 2023
b7b7c11
Change #10077: make maximum loan a positive multiple of the loan inte…
rubidium42 Jan 15, 2023
bf8b32d
Change: explicitly allow initial loan of 0, however show warning in UI
rubidium42 Jan 17, 2023
1f194eb
Fix: [Script] Incorrect value for GOAL_INVALID (#10436)
SamuXarick Feb 1, 2023
e41af1f
Update: Translations from eints
Feb 2, 2023
b364b41
Update: Translations from eints
Feb 3, 2023
6aafccf
Update: Translations from eints
Feb 4, 2023
cef9931
Cleanup: GS don't have "start_date"
glx22 Feb 3, 2023
78e3c93
Fix: caption for GS settings window opened from debug window
glx22 Feb 4, 2023
b080f24
Codechange: move windows common to AI and GS out of ai_gui
glx22 Feb 4, 2023
7c998d4
Update: Translations from eints
Feb 5, 2023
cb29442
Update: Translations from eints
Feb 6, 2023
f951ce6
Fix: Ensure logo for Windows Store common assets package is named cor…
orudge Feb 6, 2023
b5bc001
Codechange: Swap comments for CommandHelper::Post overloads (#10454)
ldpl Feb 7, 2023
0c36e4a
Update: Translations from eints
Feb 7, 2023
f12498b
Add: Show NewGRF name in NewGRF-created errors (#10457)
2TallTyler Feb 7, 2023
b083584
Update: Translations from eints
Feb 8, 2023
59251d3
Update: Translations from eints
Feb 9, 2023
d6aa526
Fix #10461, 59645c6: Properly check for _local_company validity
glx22 Feb 10, 2023
3278f4c
Fix #10280, 59645c6: Ignore double-click for unavailable town actions
glx22 Feb 10, 2023
7bd475b
Update: Translations from eints
Feb 10, 2023
6b99b66
Fix: [Script] ScriptBase::Rand() return value was between -MIN(int32)…
glx22 Feb 10, 2023
43ce73d
Fix: [Script] Use Money instead of int32 for presenting the value of …
SamuXarick Feb 9, 2023
231935f
Change: Show buy company dialog window even when playing in the AI co…
SamuXarick Feb 10, 2023
35ad964
Feature: Ctrl+Click to reset late counter for the entire vehicle group.
Feb 10, 2023
a2c8168
Fix #10465: Delay closing of network join progress window (#10466)
glx22 Feb 11, 2023
09f7f32
Update: Translations from eints
Feb 11, 2023
6452370
Add: use https:// for content-service connections (#10448)
TrueBrain Feb 12, 2023
695ce0a
Update: Translations from eints
Feb 12, 2023
04847b1
Update: Translations from eints
Feb 13, 2023
274bcf8
Fix 64523709: rpm uses different package names than deb.
frosch123 Feb 12, 2023
d7fcb42
Fix: compilation with libcurl from 2013.
frosch123 Feb 13, 2023
fe2c8a1
Codechange: Decouple INDUSTRY_CTRL into separate commands (#10475)
ldpl Feb 14, 2023
228b34c
Update: Translations from eints
Feb 14, 2023
ea90fa2
Codechange: move curl into a thread so simplify code (#10480)
TrueBrain Feb 15, 2023
1635255
Change: release with (much) newer versions of dependencies for Generi…
TrueBrain Feb 15, 2023
0722bb3
Change: try to detect the CA file/path for CURL (#10481)
TrueBrain Feb 15, 2023
1c17556
Codechange: replace instance of char * with std::string
TrueBrain Feb 15, 2023
dea2dea
Fix: reset content download progress to zero if falling back to TCP
TrueBrain Feb 15, 2023
fdfcb09
Fix #10131: actually cancel downloads when pressing cancel
TrueBrain Feb 15, 2023
27cbb81
Fix: [Actions] vcpkg needs pkg-config to build zlib on macOS (#10488)
glx22 Feb 16, 2023
4072dcf
Fix #10486: [Script] Debug window requires AIs to be started before G…
glx22 Feb 17, 2023
2fdfc38
Update: Translations from eints
Feb 17, 2023
e735370
Change: [Script] A ScriptText with too many parameters is now a fatal…
glx22 Feb 16, 2023
3559576
Codechange: [Script] Don't expose static buffers outside of ScriptText
glx22 Feb 16, 2023
3df9321
Fix: Some Script::IsValidVehicle checks need to be complemented with …
SamuXarick Jan 21, 2023
2376112
Fix #10477: Not enough space for text due to rounding down (OSX) (#10…
PeterN Feb 18, 2023
4a8b880
Update: Translations from eints
Feb 18, 2023
9ade334
Update: Translations from eints
Feb 19, 2023
8778949
Update: Translations from eints
Feb 20, 2023
92c7551
Fix #10222: Adjust line drawing algorithm (#10491)
nikolas Feb 20, 2023
7b1fd3e
Fix #10059: [Script] Clamp config item values to int32
SamuXarick Feb 3, 2023
fde7028
Fix #10059: [Script] Let custom values on a config item be up to 10 d…
SamuXarick Feb 3, 2023
bb2ac8b
Fix: [Script] Save config item values up to 10 digits + 1 for sign + …
SamuXarick Feb 3, 2023
376820c
Doc: [Script] Update info descriptions
SamuXarick Feb 4, 2023
8351b97
Add: [Script] Labels for negative values of a setting
SamuXarick Feb 4, 2023
b52b29b
Change: Avoid crashing to the side of a train
SamuXarick Feb 20, 2023
187d330
Update: Translations from eints
Feb 24, 2023
ca3cb4d
Codechange: [Script] Use a class template instead of a function templ…
michicc Jan 16, 2022
9b3326e
Codechange: [Script] Use std::vector instead of a hand-rolled alterna…
michicc Feb 23, 2023
c73b88d
Fix: Don't send unused tile field over the network (#10507)
ldpl Feb 24, 2023
2561fad
Update: Translations from eints
Feb 25, 2023
a409e4b
Add: documention to large functions that have too little documentatio…
rubidium42 Feb 25, 2023
8cbf1be
Codechange: split large function into smaller functions with self-exp…
rubidium42 Feb 25, 2023
947a789
Codechange: split large function into smaller steps and simplify logic
rubidium42 Feb 25, 2023
07fbd19
Update: Translations from eints
Feb 26, 2023
a18182e
Revert 92c7551: Line drawing algorithm fix broke other cases (#10497)
2TallTyler Feb 26, 2023
4c1406a
Add: NewGRF road stops
JGRennison Nov 6, 2022
2fee8ec
Add #7525: Allow autoreplace with same model vehicle
nielsmh Sep 8, 2019
fe27db3
Codechange: [Linkgraph] Store edges in each node and not in a global …
michicc Jan 1, 2023
564de01
Remove: SmallMatrix be gone.
michicc Jan 1, 2023
8f851ea
Codechange: [Linkgraph] Split annotation for demand between nodes fro…
michicc Jan 2, 2023
178249e
Codechange: Saveload macros for entries with a custom table name.
michicc Dec 21, 2022
7352f81
Codechange: [Linkgraph] Only store present link graph edges and not a…
michicc Jan 2, 2023
4d3da0c
Codechange: [Linkgraph] Drop node/edge wrappers from LinkGraphJob.
michicc Jan 3, 2023
aab580e
Codechange: [Linkgraph] Drop node/edge wrappers from LinkGraph.
michicc Jan 3, 2023
6eabbaa
Fix #10469, 5e14a20: [Script] League Table rating element is a int64 …
SamuXarick Feb 12, 2023
b0542c8
Codechange: Don't store tree counter in the map array (#10018)
ldpl Feb 26, 2023
6fcc872
Change: [Actions] cancel previous run if pushing new PR
TrueBrain Feb 26, 2023
eabb9db
Fix #9810: 'Rebuilding' a through road stop costs money (#9852)
wholepuncher Feb 27, 2023
20a1b24
Fix: build on platforms without native atomic
hack3ric Feb 26, 2023
0fb0469
Codechange: introduce iterator to iterate over the Tiles of a Map
rubidium42 Jan 21, 2023
7a1816a
Codechange: rename Tile to TileBase to be able to introduce a new Til…
rubidium42 Jan 21, 2023
7a6452d
Codechange: introduce Tile class for accessing map data of a single tile
rubidium42 Jan 21, 2023
580d0a6
Codechange: make use of Tile in for all direct map accesses
rubidium42 Jan 21, 2023
1eefe1c
Codechange: hide Tile(Extended) into the Tile structure
rubidium42 Jan 21, 2023
6e52cea
Feature: Industry directory text filter (#10518)
2TallTyler Feb 28, 2023
af15dca
Change: [Script] Extract params info from GS strings
glx22 Feb 17, 2023
a1fc4d5
Codechange: [Script] Merge the 3 ScriptText param arrays
glx22 Feb 18, 2023
7289738
Change: [Script] Automate the ScriptObject reference counting
rubidium42 Feb 28, 2023
991a797
Change: [Script] Validate ScriptText parameters type and amount
glx22 Feb 18, 2023
41b414b
Change: [Script] Restore support of {RAW_STRING} in ScriptText
glx22 Feb 18, 2023
6f9b3fa
Update: Translations from eints
Feb 28, 2023
e17c82e
Add: maximum number of companies allowed to the client list
Oct 3, 2022
5d0ad56
Fix : [NewGRF] Object and road stop ignore property handlers (#10525)
JGRennison Mar 1, 2023
0e4b716
Fix: O(N^2) cost of Station::RecomputeCatchmentForAll
JGRennison Sep 23, 2019
9bdcbc5
Update: Translations from eints
Mar 1, 2023
2a2e517
Cleanup 54db96b: Left-over function declaration (#10528)
glx22 Mar 1, 2023
58aa769
Update: Translations from eints
Mar 2, 2023
ec8b283
Update: Translations from eints
Mar 3, 2023
e3169c7
Fix: Restore using founder client name as company manager name (#10535)
ldpl Mar 3, 2023
44848f4
Add: CommandCost supports an optional second error string
2TallTyler Nov 19, 2018
3719f60
Add: Use specific error message when vehicle cannot go to station/way…
2TallTyler Mar 29, 2022
87f4d37
Fix #10522: Link graph line tooltip test for vertical lines (#10524)
JGRennison Mar 3, 2023
16a7bc5
Update: Translations from eints
Mar 4, 2023
01ebfad
Fix 3719f60: Crash when copying non-station orders (#10540)
ldpl Mar 4, 2023
30ae072
Fix: game scripts must not build with non-existing road types
rubidium42 Mar 4, 2023
e60632b
Update: Translations from eints
Mar 5, 2023
8fa6153
Fix 30ae072: when a road type is hidden, towns may not build them eve…
rubidium42 Mar 5, 2023
9a957f1
Change: [Script] Improve ScriptText validation error messages
glx22 Mar 5, 2023
ce8cde3
Fix: [Script] Detect circular references in ScriptText
glx22 Mar 5, 2023
67a4c5e
Codechange: Use {fmt} for script_admin JSON generation
glx22 Feb 9, 2023
e06a666
Fix: remove ScriptController constructor from API documentation
glx22 Feb 10, 2023
b6f3552
Fix: [Script] Inconsistent precondition failure return values
glx22 Feb 10, 2023
7356180
Codechange: Use SQInteger for generic numbers in script_airport
glx22 Feb 9, 2023
58bf2f7
Codechange: Use SQInteger for generic numbers in script_bridge
glx22 Feb 9, 2023
83826b1
Codechange: Use SQInteger for generic numbers in script_bridgelist
glx22 Feb 9, 2023
4042460
Codechange: Use SQInteger for generic numbers in script_cargo
glx22 Feb 9, 2023
7727323
Codechange: Use SQInteger for generic numbers in script_cargomonitor
glx22 Feb 10, 2023
89c0841
Codechange: Use SQInteger for generic numbers in script_company
glx22 Feb 10, 2023
424ae74
Codechange: Use SQInteger for generic numbers in script_companymode
glx22 Feb 10, 2023
2f40bf8
Codechange: Use SQInteger for generic numbers in script_date
glx22 Feb 10, 2023
6b8b4c3
Codechange: Use SQInteger for generic numbers in script_engine
glx22 Feb 11, 2023
e784915
Codechange: Use SQInteger for generic numbers in script_gamesettings
glx22 Feb 11, 2023
6ca8499
Codechange: Use SQInteger for generic numbers in script_goal
glx22 Feb 11, 2023
8eb3563
Codechange: Use SQInteger for generic numbers in script_group
glx22 Mar 3, 2023
6671994
Codechange: Use SQInteger for generic numbers in script_industry
glx22 Mar 4, 2023
5eaf9d3
Codechange: Use SQInteger for generic numbers in script_industrytype
glx22 Mar 4, 2023
367b2ba
Codechange: Use SQInteger for generic numbers in script_infrastructure
glx22 Mar 4, 2023
74ab9ee
Codechange: Use SQInteger for generic numbers in script_league
glx22 Mar 4, 2023
a225fda
Codechange: Use SQInteger for generic numbers in script_list
glx22 Mar 4, 2023
ca67075
Codechange: Use SQInteger for generic numbers in script_map
glx22 Mar 4, 2023
f22903a
Codechange: Use SQInteger for generic numbers in script_newgrf
glx22 Mar 4, 2023
0293fd4
Codechange: Use SQInteger for generic numbers in script_news
glx22 Mar 4, 2023
49ea69f
Codechange: Use SQInteger for generic numbers in script_objecttype
glx22 Mar 4, 2023
777b4d0
Codechange: Use SQInteger for generic numbers in script_order
glx22 Mar 4, 2023
cb2e76a
Codechange: Use SQInteger for generic numbers in script_priorityqueue
glx22 Mar 4, 2023
4f6a2f3
Codechange: Use SQInteger for generic numbers in script_rail
glx22 Mar 4, 2023
446ebaa
Codechange: Use SQInteger for generic numbers in script_road
glx22 Mar 4, 2023
a9a55f2
Codechange: Use SQInteger for generic numbers in script_station
glx22 Mar 4, 2023
cd80b31
Codechange: Use SQInteger for generic numbers in script_storypage
glx22 Mar 4, 2023
07b73a8
Codechange: Use SQInteger for generic numbers in script_subsidy
glx22 Mar 4, 2023
cada18a
Codechange: Use SQInteger for generic numbers in script_tile
glx22 Mar 4, 2023
18fe0a4
Codechange: Use SQInteger for generic numbers in script_tilelist
glx22 Mar 4, 2023
4e48bf2
Codechange: Use SQInteger for generic numbers in script_town
glx22 Mar 4, 2023
f752d96
Codechange: Use SQInteger for generic numbers in script_vehicle
glx22 Mar 4, 2023
ca14944
Codechange: Use SQInteger for generic numbers in script_window
glx22 Mar 4, 2023
665a73b
Update: Translations from eints
Mar 6, 2023
cada2ca
Add: GSCompanyMode::IsValid and IsDeity, and precondition enforcement…
rubidium42 Mar 2, 2023
83946ca
Codechange: use GSCompanyMode::IsValid, IsDeity, and the precondition…
rubidium42 Mar 2, 2023
df2b66a
Update: Translations from eints
Mar 7, 2023
b6609d1
Fix: Network server highlight invisible with RTL layout.
PeterN Jan 21, 2023
3287acd
Fix 13528bfcd0: bank balance command allows int64, GS was limited to …
rubidium42 Mar 7, 2023
c74dfe3
Fix #10556: Duplication of road infrastructure count updates (#10557)
JGRennison Mar 8, 2023
4af7f3e
Update: Translations from eints
Mar 8, 2023
d80f193
Fix: Improve grfmessage for ShipVehicleChangeInfo. (#10558)
J0anJosep Mar 8, 2023
a79f97c
Change: upon an invalid company mode, set ERR_PRECONDITION_INVALID_CO…
rubidium42 Mar 1, 2023
2fffde0
Add: workflow and script for checking missing mode enforcements
rubidium42 Mar 2, 2023
534f241
Add: precondition checks to functions that work with both valid compa…
rubidium42 Mar 2, 2023
8d443d1
Add: company mode enforcement checks to functions with command or com…
rubidium42 Mar 2, 2023
717f79f
Add: deity mode enforcement checks to functions with command or compa…
rubidium42 Mar 2, 2023
1e4a891
Fix: crashes to desktop from game scripts when companies disappear
rubidium42 Mar 2, 2023
2d32509
Fix #10554: Let Scrollbar::SetPosition clamp instead of assert. (#10555)
PeterN Mar 9, 2023
1ec34ac
Fix: Truncated music-set song names cause warning log.
PeterN Jan 26, 2023
0c4e2ce
Change: Resize jukebox when changing music set.
PeterN Mar 7, 2023
3b90b85
Change: Allow jukebox lists to fill window width.
PeterN Mar 7, 2023
e999aa2
Fix: Don't (briefly) switch from title-only playlist on menu screen.
PeterN Mar 8, 2023
64719f0
Doc: Add Coding Style into the repo for easier access (#10512)
Limyx826 Mar 10, 2023
be69aa6
Update: Translations from eints
Mar 11, 2023
24b5033
Fix #10568: "can savegame be loaded check" failed in dedicated server
rubidium42 Mar 15, 2023
0bf6d80
Update: Translations from eints
Mar 16, 2023
3254d65
Update: Translations from eints
Mar 17, 2023
1424b7b
Update: Translations from eints
Mar 18, 2023
e543889
Cleanup: Keep spacing saveload versions by groups of five (#10576)
2TallTyler Mar 19, 2023
d15a14b
Update: Translations from eints
Mar 20, 2023
1d91521
Update: Translations from eints
Mar 21, 2023
83eb73a
Update: Translations from eints
Mar 23, 2023
24e9af8
Update: Translations from eints
Mar 24, 2023
45ac237
Merge remote-tracking branch 'slow/slow_pace' into slow
smurfix Mar 28, 2023
22d3bea
fix indent
smurfix Mar 28, 2023
ad12228
The max loan editor needs to see non-paced prices
smurfix Mar 28, 2023
c0d0e4a
Also Pace-ify the monetary limit on engine renewal
smurfix Mar 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: openttd
queries:
- uses: security-and-quality
query-filters:
- exclude:
id:
# Only feasible way is to move away from fopen; fopen_s is optional C11 and not implemented on most platforms.
- cpp/world-writable-file-creation
# Basically OpenTTD's coding style for adding things like ..._INVALID to enumerations
- cpp/irregular-enum-init
71 changes: 71 additions & 0 deletions .github/script-missing-mode-enforcement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""
Script to scan the OpenTTD's script API for functions that miss checks for the
function being called from the right mode (deity or company mode).

When a function calls either ScriptObject::Command or ScriptObject::GetCompany
then the function is considered dangerous. When one of the mode enforcement
macros from script_error.hpp, i.e. EnforceDeityMode, EnforceCompanyModeValid or
EnforceDeityOrCompanyModeValid, are called in the function, then we consider
that the function has mode enforcement.

Any dangerous function for which no enforcement is found are emitted as errors.
"""

import glob
import re
import sys


def check_mode_enforcement(path):
errors = []
with open(path, "r") as reader:
mode_enforcement_found = False
dangerous_function = False
for line in reader:
# Line does not start with a tab and have <word>::<word>. That looks like the begin of a function, so reset the state.
if re.match(r"^[^\t].*\w::\w", line):
mode_enforcement_found = False
dangerous_function = False
currentFunction = line
continue

if re.match(
r"\t(EnforceDeityMode|EnforceCompanyModeValid|EnforceDeityOrCompanyModeValid|EnforceDeityOrCompanyModeValid_Void)\(",
line,
):
# Mode enforcement macro found
mode_enforcement_found = True
continue

if re.match(r".*(ScriptObject::Command|ScriptObject::GetCompany).*", line):
# Dangerous function found
dangerous_function = True
continue

# Line with only a closing bracket. That looks like the end of a function, so check for the dangerous function without mode enforcement
if re.match(r"^}$", line) and dangerous_function and not mode_enforcement_found:
function_name = currentFunction.rstrip("\n").replace("/* static */ ", "")
errors.append(f"{path}: {function_name}")

return errors


def main():
errors = []
for path in sorted(glob.glob("src/script/api/*.cpp")):
# Skip a number of files that yield only false positives
if path.endswith(("script_object.cpp", "script_companymode.cpp", "script_controller.cpp", "script_game.cpp")):
continue

errors.extend(check_mode_enforcement(path))

if errors:
print("Mode enforcement was expected in the following files/functions:")
print("\n".join(errors))
sys.exit(1)

print("OK")


if __name__ == "__main__":
main()
34 changes: 0 additions & 34 deletions .github/stale.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/unused-strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,10 @@ def main():
errors.append(f"ERROR: {string} is (possibly) no longer needed.")

if errors:
for error in errors:
print(error)
print("\n".join(errors))
sys.exit(1)
else:
print("OK")

print("OK")


if __name__ == "__main__":
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ on:
env:
CTEST_OUTPUT_ON_FAILURE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
emscripten:
name: Emscripten

runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:2.0.31
image: emscripten/emsdk:3.1.28

steps:
- name: Checkout
Expand All @@ -29,7 +33,7 @@ jobs:
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 2.0.31-${{ runner.os }}
key: 3.1.28-${{ runner.os }}

- name: Patch Emscripten to support LZMA
run: |
Expand Down Expand Up @@ -105,6 +109,7 @@ jobs:
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libicu-dev \
liblzma-dev \
Expand Down Expand Up @@ -165,16 +170,25 @@ jobs:

runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
MACOSX_DEPLOYMENT_TARGET: 10.13

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install \
pkg-config \
# EOF

- name: Prepare cache key
id: key
run: |
echo "::set-output name=image::$ImageOS-$ImageVersion"
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT

- name: Enable vcpkg cache
uses: actions/cache@v3
Expand All @@ -187,6 +201,7 @@ jobs:
- name: Prepare vcpkg
run: |
vcpkg install --triplet=${{ matrix.arch }}-osx \
curl \
liblzma \
libpng \
lzo \
Expand Down Expand Up @@ -256,7 +271,7 @@ jobs:
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg

Write-Output "::set-output name=image::$env:ImageOS-$env:ImageVersion"
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT

- name: Enable vcpkg cache
uses: actions/cache@v3
Expand Down Expand Up @@ -411,4 +426,4 @@ jobs:

steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v2
uses: OpenTTD/actions/annotation-check@v3
83 changes: 83 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CodeQL

on:
push:
branches:
- master
pull_request:
# The branches below must be a subset of the branches above
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: |
echo "::group::Update apt"
sudo apt-get update
echo "::endgroup::"

echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libicu-dev \
liblzma-dev \
liblzo2-dev \
libsdl2-dev \
zlib1g-dev \
# EOF
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive

- name: Set number of make jobs
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: /language:cpp
upload: False
output: sarif-results

- name: Filter out table & generated code
uses: advanced-security/filter-sarif@v1
with:
patterns: |
+**/*.*
-**/table/*.*
-**/generated/**/*.*
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif

- name: Upload results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: sarif-results/cpp.sarif
4 changes: 4 additions & 0 deletions .github/workflows/commit-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Commit checker
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
commit-checker:
name: Commit checker
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/preview_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:2.0.31
image: emscripten/emsdk:3.1.28

steps:
- name: Update deployment status to in progress
Expand All @@ -37,14 +37,15 @@ jobs:

- name: Name branch
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
name=$(echo "${{ github.event.client_payload.folder }}")
git checkout -b ${name}

- name: Setup cache
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 2.0.31-${{ runner.os }}
key: 3.1.28-${{ runner.os }}

- name: Patch Emscripten to support LZMA
run: |
Expand Down
Loading