Loïc Guilloux
16ebf7861f
Fix 4079c47: Missed a file when removing generated .sq files from the repo ( #9350 )
3 years ago
Loïc Guilloux
ee5f23382d
Fix: [Script] doxygen_filter is very strict about DOXYGEN_API usage ( #9351 )
3 years ago
Patric Stout
ef25afd55a
Fix #9348 , 4d74e51: don't try to sell shares of spectators ( #9349 )
...
"new_owner" can be INVALID_OWNER, and as INVALID_OWNER ==
COMPANY_SPECTATORS, we could end up trying to sell shares of
nobody.
3 years ago
Tyler Trahan
d09210e1c6
Feature: Configurable subsidy duration
3 years ago
glx22
c2db408d5d
Fix aa5a8fe28: [MinGW] Wrong define tested (WIN32 vs _WIN32)
3 years ago
glx22
d485b50813
Fix: [MinGW] Ignore wglGetProcAddress() cast warnings
3 years ago
glx22
744a9e4745
Codechange: [WIN32] Add a wrapper around GetProcAddress()
3 years ago
glx22
15f66329c2
Fix: [MinGW] Silence 2 cast warnings
3 years ago
glx22
00e3fddd0c
Fix: [MinGW] Unused squirrel code triggering a warning
3 years ago
glx22
b7250a42e1
Fix: [MinGW32] Linking error
3 years ago
glx22
2df48a78cc
Fix: [MinGW32] Can't convert lambda to stdcall
3 years ago
glx22
3ca0239985
Fix: [MinGW32] SHGFP_TYPE_CURRENT is now present in win32api
3 years ago
glx22
5d05c4919b
Codechange: [WIN32] Reduce manual dynamic loading as WinXP is the minimum version
3 years ago
glx22
f4c7d5577e
Codechange: [WIN32] Use VersionHelpers where appropriate
3 years ago
Patric Stout
ed3946e295
Add: '-X' option to ignore global folders in the search path ( #9341 )
...
This is extreme useful for automated testing. Without this, OpenTTD
will always look in your personal-dir (like ~/.local/share/openttd
or %USER%\Documents\OpenTTD). For most users this is exactly what
we want, that there is a shared place for all their files.
However, for automated testing this is rather annoying, as your
local development files influence the automated test. As such,
'-X' counters this, and only gives the local folders. This is
especially useful in combination with '-x' and '-c'.
3 years ago
rubidium42
2924ac48c5
Fix: [Script] Ensure the saved script strings are properly validated and terminated when being read from the savegame
3 years ago
rubidium42
bb8fd00760
Cleanup: [Network] Remove C-string Recv_string and its last use
3 years ago
rubidium42
ab9b937ab7
Codechange: [Network] Use std::string to get a NewGRF's name
3 years ago
Patric Stout
849a10520c
Change: allow pause/unpause console command in single player too ( #9342 )
3 years ago
rubidium42
e2417193c9
Cleanup: [ContentInfo] Remove some functions that are not needed anymore
3 years ago
rubidium42
e3717ae903
Codechange: [ContentInfo] Use std::string instead of string buffers
3 years ago
rubidium42
df181bb641
Codechange: [ContentInfo] Use a vector for dependencies instead of custom allocation
3 years ago
rubidium42
9c424ab741
Codechange: [ContentInfo] Use StringList for tags instead of custom allocations
3 years ago
rubidium42
dfb89f3891
Codechange: [ContentInfo] Do not use memset/memcpy to make it possible to use vector/string
3 years ago
rubidium42
6bb3f034e4
Cleanup: [ContentInfo] Remove unused function
3 years ago
Patric Stout
37ae6b8ae3
Add: adhere the autosave_on_exit setting for Null videodriver ( #9343 )
...
This is especially useful for automated-testing, to make a save
when the game quits while using "-vnull:ticks=N".
3 years ago
Patric Stout
174952440a
Codechange: rework CHTS-chunk save/load to be more like the others
3 years ago
Patric Stout
8f323855b1
Codechange: rename SL_LST to SL_REFLIST to highlight the "reference" part
...
You can easily mistake SlList / SL_LST to be a list of SL_VAR, but
it is a list of SL_REF. With this rename, it hopefully saves a few
people from "wtf?" moments.
3 years ago
Patric Stout
aa6443d57a
Codechange: refactor SlList to use SlStorageHelper
3 years ago
Patric Stout
23857af693
Codechange: refactor SlDequeueHelper to work with unsigned and be more generic
...
Future additions will start using it for std::list too.
3 years ago
Patric Stout
a2147d437e
Codechange: use wrappers to get Var[Mem|File]Type, instead of GB()
3 years ago
Patric Stout
fba86f711f
Codechange: move GetVariableAddress inside SlObjectMember
...
Also move it to static, as nobody else is using it.
3 years ago
Vít Šefl
f899772ec2
Fix 2e136285: Crash when CTRL-clicking on a sign ( #9345 )
3 years ago
translators
37b285ad83
Update: Translations from eints
...
spanish (mexican): 2 changes by absay
3 years ago
translators
12de256b72
Update: Translations from eints
...
german: 1 change by Wuzzy2
spanish: 1 change by ilyabakhlin
3 years ago
Patric Stout
f997eb6ca4
Fix: compatible NewGRFs in crash-log reported wrong md5 ( #9340 )
...
The text suggests it reports the original md5, but it does in fact
report the replaced md5. Now it reports both.
3 years ago
Patric Stout
1e564b333f
Codechange: make [Save|Load]Settings() behave more like other Save/Load code ( #9335 )
...
Prepare the full description and send it to SlObject. This does
require some code to be able to read to a SLE_VAR_NULL, like strings
etc, as there is no way to know their length beforehand.
3 years ago
Patric Stout
648ee88a02
Codechange: merge guiflags and flags in settings .ini files
...
It was rather confusing which one was for what, especially as some
SaveLoad flags were settings-only. Clean up this mess a bit by
having only Setting flags.
3 years ago
Patric Stout
264991dfa5
Codechange: move SLF_NO_NETWORK_SYNC into settings
...
It is a settings-only flag, so don't pollute SaveLoad code with it.
3 years ago
Patric Stout
414e12d26b
Codechange: move SLF_NOT_IN_SAVE into settings
...
It is a settings-only flag, so don't pollute SaveLoad code with it.
3 years ago
Patric Stout
7572603c9d
Codechange: remove the unused SLF_HEX flag
3 years ago
translators
d835a42c05
Update: Translations from eints
...
english (us): 1 change by 2TallTyler
catalan: 5 changes by J0anJosep
3 years ago
glx22
c27afdf3f6
Codechange: Remove FOR_ALL_CHUNK_HANDLERS
...
Co-Authored-By: Patric Stout <truebrain@openttd.org>
3 years ago
translators
3559e55b91
Update: Translations from eints
...
spanish (mexican): 1 change by absay
latvian: 2 changes by osprinkis
3 years ago
translators
ea23a9cdb6
Update: Translations from eints
...
korean: 1 change by telk5093
dutch: 1 change by Afoklala
french: 1 change by MalaGaM
3 years ago
translators
d816ff0361
Update: Translations from eints
...
korean: 1 change by telk5093
3 years ago
Patric Stout
5e44da3010
Fix ef991b17: server was trying to free() a packet created with "new CommandPacket()" ( #9334 )
3 years ago
Patric Stout
feb2ddbefa
Codechange: rename SettingGuiFlag to SettingFlag ( #9332 )
...
It is a lovely organicly grown enum, where it started off with
GUI-only flags, and after that a few flags got added that can be
considered GUI-only (the GUI disables/enables based on them), to
only have flags added that has nothing to do with the GUI.
So be less confusing, and rename them to what they do.
Additionally, I took this opportunity to rename 0ISDISABLED to
reflect what it really does.
3 years ago
Patric Stout
28e90769f7
Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
...
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
3 years ago
Patric Stout
f8dd5dd00a
Codechange: remove unused assert_msg() macro
3 years ago
translators
48ecc481ee
Update: Translations from eints
...
swedish: 1 change by joeax910
3 years ago
Vít Šefl
30f5938eed
Fix b791ffc6: use the correct name in CmdPlantTree
3 years ago
Vít Šefl
c936f8b769
Fix b791ffc6: use the correct parameter in CmdSignalTrackHelper
3 years ago
Patric Stout
9fff00ba20
Codechange: C++-ify lists for SaveLoad ( #9323 )
...
Basically, this changes "SaveLoad *" to either:
1) "SaveLoadTable" if a list of SaveLoads was meant
2) "SaveLoad &" if a single entry was meant
As added bonus, this removes SL_END / SLE_END / SLEG_END. This
also adds core/span.hpp, a "std::span"-lite.
3 years ago
translators
956d761e3e
Update: Translations from eints
...
japanese: 1 change by scabtert
3 years ago
Patric Stout
921ab68a48
Codechange: use AsIntSetting()->Read() wrapper if possible ( #9324 )
3 years ago
translators
043a544248
Update: Translations from eints
...
korean: 2 changes by telk5093
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by Vimerum
3 years ago
Rubidium
5ded596c80
Fix #9320 , 2e136285: nullptr could not be converted to string
3 years ago
rubidium42
4613ababd3
Fix #9316 , 64eddaeb: at about 250.000 inhabitants the bridge length limit check overflows
3 years ago
Patric Stout
0c96884700
Codechange: add a wrapper function to find all settings based on prefix ( #9312 )
3 years ago
Patric Stout
e9e4588db1
Codechange: use setting name instead of index for HandleOldDiffCustom() ( #9311 )
3 years ago
Patric Stout
bcd7a7aafe
Codechange: rename _SQ64 into POINTER_IS_64BIT ( #9313 )
3 years ago
rubidium42
8c273ed598
Codechange: [Network] Let admin-console use std::string(_view)
3 years ago
rubidium42
e58581f1f8
Codechange: [Network] Let admin-game script use std::string
3 years ago
rubidium42
29f2bd27c4
Codechange: [Game] Pass the length instead of '\0' terminating (and undoing that) in the middle of a C-string
3 years ago
rubidium42
8a918ce170
Codechange: [Network] Make admin name and version std::string
3 years ago
rubidium42
97c461d1e7
Fix: limit heightmap sizes to something reasonable to prevent crafted heightmaps to OOM-crash the game
3 years ago
rubidium42
e3c9ed4d15
Codechange: [Network] Use std::string to determine an unique name for clients
3 years ago
rubidium42
806f78aa04
Codechange: [Network] Use std::string to send the client name and rcon commands
3 years ago
rubidium42
fd95736bac
Codechange: [Network] Use std::string for server side logic of kicking and banning clients
3 years ago
rubidium42
f0e1cd0129
Codechange: [Network] Let server rcon result use std::string
3 years ago
rubidium42
8b9f1147df
Codechange: [Network] Let server changing a client name use std::string
3 years ago
Patric Stout
d70fb74ac6
Codechange: use setting name instead of index for CmdChange(Company)Setting ( #9306 )
...
This is mostly done as there are now constraints on settings.ini you might not
expected. For example, conditional settings always have to come last, as otherwise
they would influence the index.
3 years ago
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
3 years ago
glx22
994bf19aef
Fix f6d5c01: Delay deletion when closing windows
3 years ago
rubidium42
ef991b1772
Codechange: [Network] Use std::string in CommandPacket
3 years ago
rubidium42
2e136285e1
Codechange: move from C-string to std::string for DoCommand
3 years ago
rubidium42
661728558e
Codechange: let IsUnique.* functions accept std::string
3 years ago
rubidium42
b4aedef848
Codechange: add std::string variant of Utf8StringLength
3 years ago
Vít Šefl
0125ba82e8
Fix: Do not send vehicles towards incomplete PF nodes
...
YAPF could end up in a situation where it sets the best intermediate node
to a node whose construction is never finalized (i.e. it is never added to
the open list). The content of the node would be overwritten in the next
round, potentially sending the vehicle to an unwanted location.
3 years ago
Patric Stout
7713c3e3cc
Codechange: move casting a "const char *" to "char *" to the caller
...
It is not nice to have your definition say you won't change a value
while in fact the whole reason for your existance is to change it.
3 years ago
Patric Stout
665e3c1f45
Fix: ScriptObject::DoCommand could modify "text" while defined "const"
...
This could have unwanted side-effects, as it could change the
source for ever and ever.
3 years ago
Patric Stout
b0f44d7eb1
Doc: describe what each settings-file is about
3 years ago
Patric Stout
e58046c947
Codechange: move all settings.ini files to table/settings
3 years ago
Patric Stout
ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) ( #9304 )
...
This to be more explicit the function changes the value, and not
returns yes/no.
3 years ago
Patric Stout
4d74e51907
Fix #9281 : acquire a company uses special bookkeeping to make you rich ( #9300 )
...
When you buy-out a company, you got your shares back. This is
based on company-value, which includes values for the vehicles etc.
In other words, you not only got the vehicles, but you also got
paid to get them back.
Additionally, you also got the loan of the company, but not the
money for the loan (as that is subtracted from the company-value).
Solve this by changing the rules of a buy-out: don't sell your
shares, get the loan AND the balance and get the infrastructure.
3 years ago
rubidium42
4c0e083128
Cleanup: set the base in the setting templates, instead of defining the base for every setting
...
This has the added benefit of not getting mistaken that multiple bases can be used for the same SettingTable
3 years ago
rubidium42
4144e949ed
Fix: [Network] Prevent an empty server name to be set anywhere
3 years ago
rubidium42
08308d808c
Codechange: use separate pre and post callbacks for int settings
3 years ago
rubidium42
e2f5d9e561
Codechange: use separate pre and post callbacks for string settings
3 years ago
rubidium42
ea9715d970
Codechange: split Write_ValidateSetting to get separate functions for making ints valid and writing ints
3 years ago
rubidium42
208952f2ba
Codechange: split Write_ValidateSetting to get separate functions for making strings valid and writing strings
3 years ago
translators
ce1c60699a
Update: Translations from eints
...
norwegian (bokmal): 3 changes by Anolitt
dutch: 3 changes by Afoklala
portuguese (brazilian): 3 changes by Vimerum
3 years ago
translators
7b5c0b4236
Update: Translations from eints
...
chinese (traditional): 9 changes by benny30111
english (us): 3 changes by 2TallTyler
3 years ago
Patric Stout
7648483364
Change: by default, make "unload all" leave stations empty ( #9301 )
3 years ago
rubidium42
8372c679e3
Codechange: add helper functions to read an int setting value
3 years ago
rubidium42
86c9ef8134
Codechange: remove SettingDescType in lieu of the actual classes
3 years ago
rubidium42
e666a962b1
Codechange: let OneOfMany and ManyOfMany be their own classes as well
3 years ago
rubidium42
860003458f
Codechange: make BoolSettingDesc its own sub class
3 years ago
rubidium42
72ec81325b
Cleanup: remove unneeded temporary variables and casts
3 years ago
rubidium42
0d6597a9e6
Codechange: move bits of SettingDesc down to the appropriate sub classes
...
And by doing so remove the hack where ints were put into pointers so "def" could either be an int or a string
3 years ago
rubidium42
f58611298e
Codechange: use IntSettingDesc in the settings GUI
3 years ago
rubidium42
f6723b53da
Codechange: make parsing of IniItems overridable functions of SettingDesc
3 years ago
rubidium42
1f8ff0e4f9
Codechange: make Write_ValidateSetting a function of StringSettingDesc
3 years ago
rubidium42
be28c95b30
Codechange: make Write_ValidateSetting a function of IntSettingDesc
3 years ago
rubidium42
024e584904
Cleanup: use (config) formatting for console settings functions
3 years ago
rubidium42
c3cd4a683d
Codechange: make formatting of values into strings a method of SettingDesc
3 years ago
rubidium42
d8125fa46e
Codechange: make sub classes of SettingDesc for the different types of settings
3 years ago
rubidium42
91b3d697c5
Codechange: make SettingDesc an instance in the setting table to allow for sub classes
3 years ago
rubidium42
cf6b91f30f
Codechange: do not use SettingDescBase directly when not needed
3 years ago
rubidium42
3bb6ce8827
Codechange: use initializer_lists for the settings tables
...
Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
3 years ago
rubidium42
425d50372f
Codechange: let SettingDesc extend SettingDescBase
3 years ago
rubidium42
ac99a38175
Cleanup: remove and/or fix some confusing comments
...
The comments for SettingDescType; it is a byte, so not 4 bytes and since it is not a flag there are about 250 other possibilities left instead of 9.
SettingGuiFlag is uint16 so has 2 bytes allocated.
SettingDescGlobVarList and related comments imply that global vars cannot be used elsewhere, but they are used for settings just fine. Even then the type is not used anywhere else but the definition of the table.
3 years ago
rubidium42
8ffb4122df
Codechange: just pass the SettingDesc to SetSettingValue and remove distinction between (non)company
3 years ago
rubidium42
db54e20825
Change: mark copy-assignment as deleted for classes with a copy-constructor that is not trivial
...
This to prevent the default copy-assignment getting used when during the assignment also some other memory needs to be allocated as that would otherwise be freed.
3 years ago
rubidium42
9197de39e4
Cleanup: remove unused copy-constructor without copy-assignment
3 years ago
rubidium42
6fe4d4ad7b
Codechange: linkgraph always iterates with NodeIDs over the Size(), so make Size() the same type to prevent infinite loops
3 years ago
rubidium42
ed9e38221a
Cleanup: remove dead code; ++ on ostreambuf_iterator is a no-op
3 years ago
rubidium42
b280f16316
Codechange: remove unneeded comparison and casts
...
Division by resize_y is already yielding an unsigned number, so when clicking in the WD_FRAMERECT_TOP you would already get a huge value, so sel would never be negative. So, leave sel an unsigned number and remove the <= check.
3 years ago
rubidium42
b9797a81c0
Codechange: pass large parameter by reference instead of value, especially in a recursive function
3 years ago
rubidium42
b791ffc6de
Fix: do not hide parameter by local variable with the same name
3 years ago
rubidium42
eaa3df1e8e
Fix: part of a tile might not be marked dirty upon terraforming
3 years ago
translators
35dbd53682
Update: Translations from eints
...
russian: 3 changes by Ln-Wolf
slovak: 3 changes by FuryPapaya
spanish: 3 changes by MontyMontana
3 years ago
translators
c96945fa2b
Update: Translations from eints
...
swedish: 27 changes by joeax910
spanish (mexican): 1 change by absay
korean: 4 changes by telk5093
german: 3 changes by Wuzzy2
finnish: 3 changes by hpiirai
french: 3 changes by glx22
portuguese: 3 changes by azulcosta
3 years ago
translators
6b24cd2516
Update: Translations from eints
...
swedish: 50 changes by joeax910
3 years ago
milek7
7607277380
Fix: Network on Haiku, remove old code for BeOS
3 years ago
milek7
886f5c104a
Fix: Workarounds for BeMidi driver to work properly on Haiku
3 years ago
milek7
36bcd2956a
Fix: Building on Haiku
3 years ago
glx22
7c0762da65
Change: Show what is affected by "wagon removal" toggle
3 years ago
glx22
e99352a5d9
Change: Unhide Ctrl effect for group replace protection
3 years ago
translators
64be66216c
Update: Translations from eints
...
chinese (traditional): 3 changes by benny30111
3 years ago
Jonathan G Rennison
a896753ecc
Fix #9264 : Do not attach temporary wagons to free wagon chains when autoreplacing
3 years ago
Vít Šefl
33d99d27f4
Fix: Encountering two-way red signals could prune unrelated branches.
...
The intermediate node branch is now only pruned if the node is on the
path leading to the two-way red signal.
3 years ago
Michael Lutz
97722931a9
Fix: [OpenGL] Increase timeout when waiting for the GPU to be done with the drawing buffer.
...
The old timeout could be too short if v-sync was on on lower refresh rates.
3 years ago
translators
4f7d6cf1ba
Update: Translations from eints
...
japanese: 4 changes by akaregi
korean: 2 changes by telk5093
3 years ago
translators
7b58bfaf6c
Update: Translations from eints
...
japanese: 42 changes by akaregi
3 years ago
translators
08e71eed8b
Update: Translations from eints
...
japanese: 74 changes by akaregi
3 years ago
translators
ca9f9b84d3
Update: Translations from eints
...
japanese: 239 changes by akaregi, 18 changes by scabtert
3 years ago
translators
145f2fc43a
Update: Translations from eints
...
indonesian: 14 changes by NinjaQuince
3 years ago
translators
7caceb26f7
Update: Translations from eints
...
korean: 1 change by telk5093
indonesian: 55 changes by NinjaQuince
3 years ago
rubidium42
e2dc5aa83e
Codechange: [Network] Use C++ string functions to generate company password hash
3 years ago
translators
e2e06633c9
Update: Translations from eints
...
norwegian (bokmal): 1 change by Anolitt
slovak: 1 change by FuryPapaya
3 years ago
rubidium42
4d246cda73
Codechange: [Network] Let NetworkClientInfo use std::string
3 years ago
rubidium42
83679c0e57
Codechange: [Network] Use std::string to populate the client list for company stats
3 years ago
rubidium42
e90b2649b6
Codechange: [Network] Let NetworkCompanyInfo use std::string
3 years ago
Rubidium
5c01f9ea52
Fix #9267 , 47a99bb: [Squirrel] Heap use after free
...
Due to 47a99bb
the order of elements in the garbage collection chain has
changed causing the class to be finalised before the instances of that class.
Since the instance's array of member values depends on the size of the values
in the class, the class finalisation resetting that size to 0 causes not all
finalisations to run, which subsequently causes a heap use after free. So,
just set the SQObjectPtrs to 'null' during the finalisation of the SQClass
so the SQInstance can release all instance variables during its finalisation.
3 years ago
glx22
e66e25ff71
Fix #9269 , f6d5c01: Hide windows without abusing WC_INVALID
3 years ago
translators
2e43f91891
Update: Translations from eints
...
estonian: 1 change by siimsoni
indonesian: 39 changes by w13
3 years ago
rubidium42
fab120ee83
Codechange: [Network] Let chat communication use std::string
3 years ago
rubidium42
ae85af98eb
Codechange: Use std::string GetString where convenient
3 years ago