Commit Graph

668 Commits (ed1457dca335a68b74603b619584eff9f7231ef4)

Author SHA1 Message Date
glx22 ed1457dca3 Fix 55170ae: [Script] Building two-way signals could end up one-way 2 years ago
Loïc Guilloux 7331149dde
Codechange: [CMake] Pass API files list via a file to minimise command line length (#9874) 2 years ago
Tyler Trahan f4ca94d3f6 Codechange: Revenue is not the same as Income
Income is revenue minus costs. Let's name things correctly (without breaking the script API).
2 years ago
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2 years ago
Andy b8a8891a86 Add: [Script] IndustryType::ResolveNewGRFID to resolve industry id from grfid and grf_local_id 2 years ago
Andy 26ac0c48f0 Add: [Script] ObjectType::ResolveNewGRFID to resolve object id from grfid and grf_local_id 2 years ago
Michael Lutz 3fede15940 Codechange: [Script] Prettify squirrel call helpers by using C++17. 2 years ago
Michael Lutz 41fa16f325 Codechange: Don't use globals for return values from vehicle command procs. 3 years ago
Michael Lutz 57b82e2e99 Codechange: Don't use globals for story/goal/sign/group command proc return values. 3 years ago
Michael Lutz 3e85e833a7 Codechange: Add support for additional command result values. 3 years ago
Michael Lutz 8503854655 Codechange: Pass unpacked command arguments to command callbacks (except Script). 3 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 3 years ago
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 3 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 3 years ago
Michael Lutz e6e69d5289 Codechange: Un-bitstuff goal and story page commands. 3 years ago
Michael Lutz 1a42a8a5d5 Codechange: Un-bitstuff town-related commands. 3 years ago
Michael Lutz e08b3abe7f Codechange: Un-bitstuff group and autoreplace commands. 3 years ago
Michael Lutz 46bd2f1ced Codechange: Un-bitstuff remaining transport infrastructure commands. 3 years ago
Michael Lutz 55170ae703 Codechange: Un-bitstuff rail commands. 3 years ago
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 3 years ago
Michael Lutz 21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 3 years ago
Michael Lutz 211c630cbe Codechange: Un-bitstuff order commands. 3 years ago
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 3 years ago
Michael Lutz ccefa76a46 Codechange: Template DoCommandPInternal. 3 years ago
Michael Lutz 6691ee3b96 Codechange: Template script command calls. 3 years ago
Michael Lutz eab18f06a4 Codechange: Pass additional data as byte stream to command callbacks. 3 years ago
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
3 years ago
Michael Lutz b0990fcff7 Codechange: Make TileIndex a "strong" typedef to give it a distinct type.
This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
3 years ago
Michael Lutz 123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 3 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 3 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 3 years ago
Loïc Guilloux eed49d7792
Fix #9626, ddafc0d: Incorrect loading of script saved data (#9629) 3 years ago
Loïc Guilloux a53cfeef13
Fix #9548, e5fedcd: [Squirrel] Crash during engine cleanup after reaching memory limit on realloc (#9592) 3 years ago
Loïc Guilloux ccd586a736
Fix #9588, 140a96b: [Squirrel] Reaching memory limit during script registration could prevent further script detections (#9589)
Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
3 years ago
Patric Stout 394c749b6b
Change: Heading for 13 now (#9573) 3 years ago
dP 39662aabef
Add: allow gamescripts to build neutral objects (#9568) 3 years ago
SamuXarick 37de878129
Feature: [AI/GS] Missing water related functions and objects (#8390) 3 years ago
Patric Stout eca73a810c Change: rebrand 1.12.0 to 12.0
One question that keeps popping up: "when do we release 2.0?".
NewGRF will force that at least 1.16 will be 2.0, but to not wait
for this, let's drop the "1." and be for ever done with that
conversation.

We are following in the footstep of giants here.
3 years ago
SamuXarick 120d216b0b
Add: [AI] Get the number of vehicles in a given group (#9462) 3 years ago
Michael Lutz b14681891d Fix 8706dcd9: [Script] Byte-swap grfids to match normal expectations. 3 years ago
Loïc Guilloux 4eb368c786
Fix 14f197c: [Script] int64 values don't fit into int (#9465) 3 years ago
Michael Lutz 8706dcd9c1
Add: [Script] Basic information about loaded NewGRFs for scripts. (#9464)
Currently, scripts use various heuristics to detect loaded NewGRFs that are inherently unreliable.
The list of loaded NewGRFs is easily accessible to a human player, and thus giving
scripts the same information is consistent with the current approach to not give scripts
more information than a human player.
3 years ago
Charles Pigott 549a58731f Codechange: Remove (unused) ability to specify min/max of OverflowSafeInt 3 years ago
Rubidium 01139d3368 Codechange: access the name of a setting via an accessor function 3 years ago
Loïc Guilloux ddafc0de05
Fix 39e90ec: Integers for scripts are 64bit, but saved as 32bit (#9415) 3 years ago
Patric Stout 7dd5fd6ed4 Feature: framework to make savegames self-descriptive
We won't be able to make it fully self-descriptive (looking at you
MAP-chunks), but anything else can. With this framework, we can
add headers for each chunk explaining how each chunk looks like
in detail.

They also will all be tables, making it a lot easier to read in
external tooling, and opening the way to consider a database
(like SQLite) to use as savegame format.

Lastly, with the headers in the savegame, you can freely add
fields without needing a savegame version bump; older versions
of OpenTTD will simply ignore the new field. This also means
we can remove all the SLE_CONDNULL, as they are irrelevant.

The next few commits will start using this framework.
3 years ago
Rubidium 281a65b3e1 Cleanup: simplify some boolean expressions 3 years ago
Rubidium 3237e97b35 Cleanup: [Script] Use nullptr instead of 0 or NULL 3 years ago
Patric Stout 97b94bdc9a Change: prefix SL_ARR with the length of the array
This means that during loading we can validate that what is saved
is also that what is expected. Additionally, this makes all list
types similar to how they are stored on disk:
First a gamma to indicate length, followed by the data.
The size still depends on the type.
3 years ago