Commit Graph

45 Commits (1c205b2cdac737a4563f7ec23b2885b1c3e1654a)

Author SHA1 Message Date
Michael Lutz 1c205b2cda Fix #10212: [Script] Nested ScriptAccounting scopes are not restored properly. 2 years ago
Michael Lutz 41fa16f325 Codechange: Don't use globals for return values from vehicle command procs. 2 years ago
Michael Lutz 57b82e2e99 Codechange: Don't use globals for story/goal/sign/group command proc return values. 2 years ago
Michael Lutz 3e85e833a7 Codechange: Add support for additional command result values. 2 years ago
Michael Lutz 8503854655 Codechange: Pass unpacked command arguments to command callbacks (except Script). 2 years ago
Michael Lutz 6691ee3b96 Codechange: Template script command calls. 2 years ago
Michael Lutz eab18f06a4 Codechange: Pass additional data as byte stream to command callbacks. 2 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.
2 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 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 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
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 3 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Niels Martin Hansen 0549a81c30 Fix b3fd7879: Ignore command flags when verifying script commands
Multiplayer games has the server add some flags to the cmd value during the handling.
These flags should not be included in the verification, mask them out. Without this
masking out, scripts tend to die when executing their first command in multiplayer.
5 years ago
glx22 b3fd787959 Fix #7188: check the validity of command callback for scripts (#7701) 5 years ago
Niels Martin Hansen 140a96b3a0 Change: Limit memory allocations for each Squirrel instance
This can avoid out-of-memory situations due to single scripts using up the entire address space.
Instead, scripts that go above the maximum are killed.
The maximum is default 1 GB per script, but can be configured by a setting.
5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
5 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium 0460b78515 (svn r26093) -Fix (r26092): compilation error 11 years ago
rubidium 168fa4129d (svn r26092) -Fix [FS#5818]: prevent scripts from crashing OpenTTD when they send text with command codes to user editable texts such as sign and station names 11 years ago
rubidium 19eca468fc (svn r25488) -Fix [FS#5613]: do not send encoded texts to names, but decode them into a plain C string and then pass them on 11 years ago
zuu 9aa1bf0264 (svn r25342) -Add: StoryPage data structures and GS API 11 years ago
zuu a58427115c (svn r25305) -Fix [FS#5561]: Game Script APIs that execute a DoCommand were returning the same result as in TestMode during world generation 11 years ago
rubidium 22637f139f (svn r24008) -Cleanup/doc: try not to mention (No)AI in script APIs 12 years ago
rubidium df963509f6 (svn r23778) -Fix [FS#4957]: trim all control codes and the likes from strings being passed into the AI. If the AI would be displaying them later we would be showing those control codes as question marks. 13 years ago
rubidium 4479f90843 (svn r23777) -Codechange: refactor allocating memory and fetching strings into a single function for scripts 13 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
truebrain cc3f42794d (svn r23632) -Add: GSCompanyMode, to change company in GameScripts 13 years ago
truebrain 3ada3b9cc5 (svn r23630) -Add: a Goal GUI to show your current goals 13 years ago
truebrain 83f2785f54 (svn r23611) -Add: run the begin of the script already while generating, and don't sleep on DoCommand while doing so 13 years ago
frosch 0a7b49e398 (svn r23515) -Cleanup: Remove unused ScriptObject::GetNewTunnelEndtile() and relatives. 13 years ago
truebrain 2c877b074e (svn r23369) -Codechange: use script includes when possible, not ai includes 13 years ago
truebrain 880f377fa6 (svn r23367) -Codechange: refactor GetSetting to ScriptInstance, to avoid global variable in script_controller 13 years ago
truebrain ae8540f5e0 (svn r23361) -Codechange: move multiplayer DoCommand callback code so other script users can call their own 13 years ago
truebrain 3da8b5097a (svn r23360) -Codechange: move AIInstance to ScriptInstance, making it reusable by other script API instances 13 years ago
truebrain 75c4bd280a (svn r23359) -Codechange: move AI_VMSuspend to Script_Suspend (and to its own file) 13 years ago
truebrain bbd9facb44 (svn r23358) -Codechange: move AI_FatalError to Script_FatalError (and to its own file) 13 years ago
truebrain 99cb93ef6f (svn r23357) -Codechange: move AIStorage to ScriptStorage 13 years ago
truebrain 98103121d4 (svn r23355) -Codechange: rename all AI* to Script* (Rubidium) 13 years ago
truebrain afdb67a353 (svn r23354) -Codechange: move all src/ai/api/ai_*.[hc]pp files to src/script/api/script_* (Rubidium) 13 years ago