Commit Graph

82 Commits

Author SHA1 Message Date
Rubidium bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 2024-03-10 10:14:20 +01:00
Loïc Guilloux ef40c5e240
Fix #12225, 977aba7: [Script] Missing AI:ResetConfig support for running AI config (#12226) 2024-03-06 21:16:07 +01:00
Loïc Guilloux 845b894fd8
Remove: [Script] random_deviation from setting description table (#12221) 2024-03-05 12:41:04 +01:00
Loïc Guilloux 25d1238907
Fix #12133: [Script] Don't crash when emergency saving (#12138) 2024-02-20 18:55:18 +01:00
Loïc Guilloux 8d9fa0ea89
Change: [Script] Use company randomizer when adding random deviation (#12065) 2024-02-11 18:58:41 +00:00
Loïc Guilloux 977aba73be
Change: Store running AI config inside Company (#12003) 2024-02-09 22:55:49 +01:00
Loïc Guilloux ab1407fc43
Fix: [Script] Apply random deviation only at script start (#11944) 2024-02-01 10:48:40 +01:00
Peter Nelson 0ca4b4e146 Change: Allow opening multiple script debug windows by holding Ctrl. 2023-12-20 20:39:07 +00:00
Rubidium 07860e67e2 Codechange: use fmt::format_to to format the help message 2023-05-20 16:50:03 +02:00
Rubidium 9f2fc860ad Codechange: use std::optional<std::string> for changing the script over char * 2023-05-14 22:54:10 +02:00
Rubidium 0fd9eb0faa Codechange: use std::string for script info/library finding 2023-05-14 22:54:10 +02:00
Patric Stout ed83c4b0da
Change: replace per-AI "start_date" with a global "competitors_interval" (#10653)
The per-AI "start_date" is a lot of custom code, and was rarely
used in the way it was meant.

While at it, also ported this part over to the new timer system.
2023-04-16 20:14:22 +02:00
glx22 b080f24bd8 Codechange: move windows common to AI and GS out of ai_gui 2023-02-05 19:27:25 +01:00
SamuXarick df89c34e03
Fix 7e1e275: Measure AI Collect Garbage performance (#9924) 2023-01-28 20:18:28 +01:00
Loïc Guilloux fe30f66570
Fix #9720: Delay start of GS/AI to after loading of savegame (#9745) 2022-12-28 05:02:26 +01:00
Charles Pigott 9059215b3b Fix #10073: Stop truncating output of list_ai and friends commands 2022-10-10 13:42:07 +01:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
glx 3a14cea068 Codechange: Replace FOR_ALL_COMPANIES with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
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.
2019-03-20 19:24:55 +01:00
Niels Martin Hansen 7e1e2756d4 Add: Show performance of AI and GS in framerate window 2019-02-23 14:29:07 +01:00
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 2014-04-23 20:13:33 +00:00
rubidium 81ce9ad189 (svn r25592) -Fix [FS#5644]: Changing the script difficulty level in-game would also change the settings using the default even though they were not allowed to change in-game 2013-07-12 18:54:27 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
zuu f3f4c562ff (svn r24537) -Feature: Scripts can be suspended even if the game is still progressing, thus break-on-log now works also for Game Scripts. 2012-09-21 19:58:18 +00:00
yexo fe31aa28c4 (svn r24487) -Codechange [FS#5236]: make several DoesContentExist return the path instead of a boolean (LordAro) 2012-08-20 21:01:40 +00:00
frosch d7d89bc806 (svn r24108) -Fix [FS#5142]: When starting GS or AI, always use the settings of the game, not the new-game settings. 2012-04-09 12:35:01 +00:00
truebrain 251687f795 (svn r23746) -Fix: also set 'info' to NULL if 'instance' dies (for both AI and GS); avoids invalid memory reads 2012-01-03 23:09:48 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
rubidium 37b136576d (svn r23718) -Fix [FS#4936]: rescanai caused crash when the AI settings of an AI was opened 2012-01-02 20:39:50 +00:00
truebrain cc3f42794d (svn r23632) -Add: GSCompanyMode, to change company in GameScripts 2011-12-19 21:05:25 +00:00
truebrain 2ecbe89509 (svn r23524) -Codechange: move the name of the scanner to a level deeper 2011-12-15 19:52:44 +00:00
truebrain a8b22e5292 (svn r23386) -Fix: debug script related events to 'script' (removes 'ai') 2011-12-01 12:04:10 +00:00
rubidium 582601b2f7 (svn r23377) -Fix: compilation failure when networking is disabled 2011-11-30 06:20:14 +00:00
truebrain 34d7f01ccc (svn r23364) -Codechange: refactor AIConfig, moving it mostly to Scriptconfig 2011-11-29 23:26:35 +00:00
truebrain e37149a1de (svn r23362) -Codechange: refactor AIScanner, splitting it in AIScannerInfo and AIScannerLibrary 2011-11-29 23:21:52 +00:00
truebrain ae8540f5e0 (svn r23361) -Codechange: move multiplayer DoCommand callback code so other script users can call their own 2011-11-29 23:21:42 +00:00
truebrain 98103121d4 (svn r23355) -Codechange: rename all AI* to Script* (Rubidium) 2011-11-29 23:15:35 +00:00
truebrain afdb67a353 (svn r23354) -Codechange: move all src/ai/api/ai_*.[hc]pp files to src/script/api/script_* (Rubidium) 2011-11-29 23:07:38 +00:00
truebrain d03bbdd4ac (svn r23295) -Codechange: put ImportLibrary in AIController (and document the parameters for NoAI docs) 2011-11-23 13:39:36 +00:00
rubidium 4ae8bbea07 (svn r23222) -Codechange: reduce tar scanning calls to the bare minimum 2011-11-14 21:40:39 +00:00
truebrain b7a655bf4c (svn r23209) -Codechange: track the current active script instance directly, instead of assuming the current company points you to the right one. 2011-11-13 20:43:48 +00:00
rubidium f5dd74499b (svn r22829) -Codechange: unify the dirtying of windows after an AI scan 2011-08-24 16:38:09 +00:00
yexo cf11a1e98e (svn r22534) -Fix [FS#4631] (r21250): doing rescan_ai in a game with running AIs caused a crash 2011-06-03 19:18:39 +00:00
rubidium 79fd8a362b (svn r22007) -Change: only show one AI per unique ID instead of all versions in the output of "openttd -h" 2011-02-07 09:51:16 +00:00
yexo 8e3e93b96f (svn r21703) -Feature [FS#4372]: list_ai_libs console command to get a list of recognized AI libraries (dihedral) 2011-01-03 14:52:30 +00:00
rubidium 30f2afac9b (svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to some headers 2010-08-26 22:01:16 +00:00