Commit Graph

40 Commits

Author SHA1 Message Date
Rubidium 98972a0748 Codechange: use C++ strings for constructing script file paths 2023-05-14 22:54:10 +02:00
Rubidium a30f7c83bd Codechange: use std::string for script names to load 2023-05-14 22:54:10 +02:00
Rubidium bc389a86c9 Codechange: use std::string as std::map key, instead of stredup string 2023-05-09 23:14:48 +02:00
Rubidium 72082aa7d3 Codechange: use std::string for getting a script's name 2023-05-09 23:14:48 +02:00
Rubidium 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 2023-04-29 10:25:25 +02:00
Charles Pigott 9059215b3b Fix #10073: Stop truncating output of list_ai and friends commands 2022-10-10 13:42:07 +01:00
Rubidium d31a535c87 Cleanup: remove some unneeded c_str() calls 2021-06-15 06:13:00 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
glx22 34215f7faa Codechange: Replace FOR_ALL_TARS with range-based for loops 2021-05-03 19:46:57 +02:00
Rubidium 4400bbfa96 Change: [Script] Let Script_FatalError use std::string instead of const char * 2021-04-17 22:24:52 +02:00
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 2020-12-27 13:19:25 +01:00
Patric Stout f66baa444f
Codechange: use C++11 constructs for for-each loops (#8432) 2020-12-25 19:38:18 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
glx 09004f3697 Codechange: catch script exceptions by reference 2019-05-15 21:59:57 +02:00
glx a82e7ec281 Fix #7590: handle script exceptions during scanning 2019-05-15 21:59:57 +02: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
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 2018-12-27 18:09:16 +01:00
rubidium a6b4e59963 (svn r26617) -Fix [FS#5973]: [Script] Loading/parsing of info .nuts was done in the same VM, causing e.g. constants to break the loading of info of other scripts 2014-05-25 19:53:46 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium 66743167c9 (svn r26501) -Fix: Windows compilation error 2014-04-24 18:44:29 +00:00
rubidium a5274117bd (svn r26487) -Codechange: use lastof instead of lengthof/sizeof for script names 2014-04-23 21:16:58 +00:00
rubidium 5b82822c12 (svn r26486) -Codechange: replace a number of snprintfs with seprintf 2014-04-23 21:12:09 +00: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 f4c9ba4981 (svn r25546) -Fix: two small memory leaks 2013-06-30 20:40:49 +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
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain 1616961ea2 (svn r23613) -Add: allow IsDeveloperOnly in info.nut, to indicate if you can select this GS via the GUI (optional, defaults to false) 2011-12-19 20:57:08 +00:00
truebrain a8b22e5292 (svn r23386) -Fix: debug script related events to 'script' (removes 'ai') 2011-12-01 12:04:10 +00:00
truebrain e37149a1de (svn r23362) -Codechange: refactor AIScanner, splitting it in AIScannerInfo and AIScannerLibrary 2011-11-29 23:21:52 +00:00
truebrain 00877dd6d3 (svn r23352) -Add: support dynamically adding an API prefix when returning a C++ class to Squirrel 2011-11-29 22:24:30 +00:00
rubidium 748bddb31a (svn r22906) -Fix (r22905): variable not properly cleared before use 2011-09-08 10:02:43 +00:00
rubidium 62777dbd84 (svn r22905) -Fix [FS#4753] (r22836): the name of the tar was removed from the AI filenames, so record it differently. Also removes some of the hackery to get the tar's filename 2011-09-08 09:55:04 +00:00
rubidium 414c397000 (svn r22904) -Codechange: add tar filename to file scanning 2011-09-08 09:48:52 +00:00
rubidium d839aa0475 (svn r22836) -Codechange: simplify the scanning of (AI) scripts 2011-08-25 10:37:28 +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
rubidium 8a2fecbff5 (svn r19776) -Change: don't scan for tars in the script scanner; it has already happened. 2010-05-10 09:35:25 +00:00
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 2009-10-04 17:16:41 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
yexo ce4744e1d6 (svn r15736) -Codechange: Split AIScanner/AIFileInfo to the more generic classes ScriptScanner/ScriptFileInfo. 2009-03-15 22:41:57 +00:00