Commit Graph

30 Commits

Author SHA1 Message Date
Peter Nelson 400ae65ff2 Codechange: Redefine some cargo-related values in terms of CargoID instead of CargoType.
Values used as special filter types are now defined as offsets from NUM_CARGO instead of confusingly reusing CARGO_NO_REFIT/CARGO_AUTO_REFIT types.
2024-01-09 18:56:05 +00:00
Rubidium 8d443d1379 Add: company mode enforcement checks to functions with command or company access
Command functions are those that call ScriptObject::Command, and functions
with company access are any that call ScriptObject::GetCompany. This is a bit
over-protective, but having the check everywhere makes it easier to validate
that no check is missing automatically instead of by review.
2023-03-08 22:33:47 +01:00
glx22 777b4d0987 Codechange: Use SQInteger for generic numbers in script_order 2023-03-06 00:32:12 +01:00
SamuXarick 3df9321a65 Fix: Some Script::IsValidVehicle checks need to be complemented with IsPrimaryVehicle
Add: [Script] ScriptVehicle.IsPrimaryVehicle
2023-02-18 09:58:02 +01:00
Rubidium 90f1768006 Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
2023-01-14 21:15:23 +01:00
Nicolas Chappe a9a21e784d Codechange: Always set the ODATFB_NEAREST_DEPOT flag for 'any depot' orders 2022-10-22 14:19:08 +02:00
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2022-02-15 20:01:10 +01:00
Michael Lutz 211c630cbe Codechange: Un-bitstuff order commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 6691ee3b96 Codechange: Template script command calls. 2021-12-16 22:28:32 +01:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
glx22 38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 2021-05-13 00:13:54 +02:00
SamuXarick 4d4005d8b7 Fix #8039: [AI/GS] SetOrderFlags and GetOrderDestination didn't work for oil rigs 2020-03-30 08:18:32 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Jonathan G Rennison d71a7c21da Fix #7593: Crash in ScriptOrder::GetOrderDistance in VT_AIR mode
Null pointer dereference occurred when either origin_tile or dest_tile
were waypoint tiles.
2019-07-22 20:26:36 +01:00
peter1138 f538179878 Feature: Multi-tile docks and docking points. 2019-06-30 16:46:32 +02:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Eddi-z 13056aedbc Add: Conditional order for max. reliability (patch by Cirdan, #6360) (#7017) 2019-01-05 22:10:37 +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
frosch 2e79fd9c40 (svn r26148) -Fix [FS#5824] (r25735): Script API failed for vehicles with only implicit orders. 2013-12-08 15:13:06 +00:00
rubidium 6e12838376 (svn r25612) -Fix [FS#5648]: [AI] Don't return ERR_UNKNOWN when trying to move an order to its current location 2013-07-14 20:21:36 +00:00
michi_cc ef394916c9 (svn r24353) -Fix [FS#5215] (r23506): [NoAI] A TileIndex isn't a station id, so don't use it as one. 2012-06-23 15:02:20 +00:00
rubidium 22637f139f (svn r24008) -Cleanup/doc: try not to mention (No)AI in script APIs 2012-03-04 16:54:12 +00:00
rubidium e6a828def1 (svn r24006) -Fix [FS#5088]: AI used in names in API for GSOrder 2012-03-04 16:40:06 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
michi_cc a085ea9e4b (svn r23506) -Add: [NoAI] Support for dealing with aircraft range. 2011-12-13 00:43:59 +00:00
truebrain a8b22e5292 (svn r23386) -Fix: debug script related events to 'script' (removes 'ai') 2011-12-01 12:04:10 +00:00
truebrain 2c877b074e (svn r23369) -Codechange: use script includes when possible, not ai includes 2011-11-29 23:27:17 +00:00
truebrain 3da8b5097a (svn r23360) -Codechange: move AIInstance to ScriptInstance, making it reusable by other script API instances 2011-11-29 23:21:33 +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
Renamed from src/ai/api/ai_order.cpp (Browse further)