1
0
Fork 0
OpenTTD/src/script
Rubidium 4cda9f900d Codechange: [Script] Use helper function over direct casting CompanyID
In the script's API `COMPANY_INVALID` has a value of -1, whereas the internal
game's `INVALID_COMPANY` has a value of 255. Since the script's API also has
a `COMPANY_SPECTATOR` with a value of 255, these enumerations cannot be easily
reconciled by casting. As such, replace all casts in the script API with
either ScriptCompany::FromScriptCompanyID or ScriptCompany::ToScriptCompanyID.

Also make clear whether CompanyID is ::CompanyID or ScriptCompany::CompanyID
by using either one of those over CompanyID in the script's API.
2025-02-08 23:42:19 +01:00
..
api Codechange: [Script] Use helper function over direct casting CompanyID 2025-02-08 23:42:19 +01:00
CMakeLists.txt Codechange: move windows common to AI and GS out of ai_gui 2023-02-05 19:27:25 +01:00
script_cmd.h Codechange: Pass unpacked command arguments to command callbacks (except Script). 2021-12-16 22:28:32 +01:00
script_config.cpp Remove: [Script] random_deviation from setting description table (#12221) 2024-03-05 12:41:04 +01:00
script_config.hpp Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
script_fatalerror.hpp
script_gui.cpp Codechange: Pass raw string to editable query window. (#13481) 2025-02-07 17:03:53 +00:00
script_gui.h Change: Allow opening multiple script debug windows by holding Ctrl. 2023-12-20 20:39:07 +00:00
script_info.cpp Codechange: range based for loops instead of C-style for loops 2024-04-11 07:05:04 +02:00
script_info.hpp Codechange: Remove CCountedPtr. 2024-10-16 21:52:00 +01:00
script_info_dummy.cpp Codechange: use fmt::format to create dummy scripts 2023-05-14 22:54:10 +02:00
script_instance.cpp Codechange: Use std::visit for ScriptDataVariant. 2024-11-23 10:55:41 +00:00
script_instance.hpp Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
script_scanner.cpp Codechange: Replace all FILE * with FileHandle RAII class. (#12718) 2024-09-16 08:45:26 +01:00
script_scanner.hpp Codechange: use fmt::format_to to format the help message 2023-05-20 16:50:03 +02:00
script_storage.hpp Codefix: Script's last_error is not a StringID. (#13227) 2025-01-01 21:35:41 +00:00
script_suspend.hpp
squirrel.cpp Codechange: Replace all FILE * with FileHandle RAII class. (#12718) 2024-09-16 08:45:26 +01:00
squirrel.hpp Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
squirrel_class.hpp
squirrel_helper.hpp Codechange: Make Squirrel handle ConvertibleThroughBase. (#13453) 2025-02-04 01:15:58 +00:00
squirrel_helper_type.hpp Codechange: automatic adding of _t to (u)int types, and WChar to char32_t 2023-07-19 19:30:14 +02:00
squirrel_std.cpp Codechange: use C++ strings for constructing script file paths 2023-05-14 22:54:10 +02:00
squirrel_std.hpp