Commit Graph

45 Commits

Author SHA1 Message Date
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
PeterN 2a2443dd01
Feature: Create group of vehicles from manage vehicle list button. (#10890) 2023-06-18 20:48:04 +01:00
PeterN 2097719f26
Fix: Don't restore backed up vehicle name if it's no longer unique. (#10979) 2023-06-09 21:18:55 +00:00
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2022-02-15 20:01:10 +01:00
Jonathan G Rennison e08a6e2014 Fix #9735: Fix OrderBackup::Reset in non-GUI case 2021-12-19 16:53:10 +01:00
Michael Lutz d85348b1d1 Codechange: Template the command callback function type to allow unpacked arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz e08b3abe7f Codechange: Un-bitstuff group and autoreplace commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 211c630cbe Codechange: Un-bitstuff order commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 2021-12-16 22:28:32 +01:00
Michael Lutz ccefa76a46 Codechange: Template DoCommandPInternal. 2021-12-16 22:28:32 +01:00
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP 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.
2021-12-16 22:28:32 +01:00
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.
2021-12-16 22:28:32 +01:00
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2021-12-16 22:28:32 +01:00
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
Rubidium 5ded596c80 Fix #9320, 2e136285: nullptr could not be converted to string 2021-05-30 19:59:49 +02:00
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
glx22 d8605ad18d Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loops 2020-12-27 10:28:46 +00:00
glx 9892d90b26 Codechange: Replace order related FOR_ALL 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
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz 2cf7ac2863 Fix #7391, 9b99b95: Don't invalidate go to depot orders of non-aircraft when invalidating hangar orders that happen to share IDs.
This was caused because hangars are referred to by station ID, which is not unique with respect to depot IDs.
2019-03-21 19:15:59 +00: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
Samu 9b99b95955 Fix #6574: Remove go to hangar orders when rebuilding airport
When replacing an airport with another, cancel current orders of type 'go to depot' from aircraft still heading to it if the rebuilt airport doesn't have a hangar (helicopter vs heliport), or if the airplane can't land on the rebuilt airport (airplane vs helistation).

Removes 'go to hangar' orders from all aircraft when replacing an airport with hangar with another without hangar (heliport).
2019-02-27 00:06:57 +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 9527bad3a7 (svn r24446) -Add [FS#5199]: Store more consist properties in order backups. 2012-07-29 16:48:00 +00:00
frosch 5ce1971588 (svn r24444) -Codechange: Base OrderBackup on BaseConsist. 2012-07-29 16:45:34 +00:00
rubidium d9b9ac6013 (svn r23464) -Fix [FS#4876]: clear the backed up orders of a removed station as well, otherwise one could create orders to a station that was never in the original backupped orders. For example a road vehicle trying to go to a buoy. 2011-12-09 20:48:13 +00:00
rubidium fb63543e2a (svn r23199) -Fix [FS#4822]: oil rigs that "expired" did not get removed from the station list 2011-11-12 18:06:34 +00:00
planetmaker 43c8cd1d5e (svn r22473) -Codechange: Automatic orders are better called implicit orders as no real order influencing path finding is added 2011-05-18 12:19:58 +00:00
rubidium 4d5dbf5170 (svn r22410) -Document: some more bits ;) 2011-05-02 16:14:23 +00:00
smatz 756cc6cf65 (svn r22116) -Codechange: use PoolBase::Clean() at more places 2011-02-19 23:05:47 +00:00
yexo 421ba1c342 (svn r22047) -Fix: selling a vehicle triggered the assert added in r22041 2011-02-10 13:17:24 +00:00
frosch a97d52a29a (svn r21933) -Codechange: Split cur_order_index into cur_auto_order_index and cur_real_order_index to keep track of the current real order in an unambiguous way.
-Fix [FS#4440]: Automatic orders behave now stable wrt. service orders and are not added or removed depending on the need of servicing.
-Fix: Various other issues with automatic orders, e.g. vehicles getting stuck with "no orders" when there are automatic orders at the end of the order list.
2011-01-31 20:44:15 +00:00
rubidium 9ca4b629cd (svn r21846) -Codechange: move documentation towards the code to make it more likely to be updated [o-s]. 2011-01-18 23:09:43 +00:00
rubidium f570285653 (svn r21438) -Fix (r21424): fix triggered an assertion when the build did support networking 2010-12-08 18:21:29 +00:00
rubidium 0f2402306c (svn r21424) -Fix: CMD_CLEAR_ORDER_BACKUP might not get executed when the user pressed the shift key 2010-12-07 20:45:11 +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 e89a0fb7f9 (svn r20571) -Codechange: free/reserve some bits in the order commands to increase the vehicle pool limit 2010-08-19 20:39:12 +00:00
rubidium 926594b599 (svn r20547) -Change: the way order backups are performed. Now restoring an order doesn't require up to 765 commands. 2010-08-18 20:48:38 +00:00
rubidium 019878118d (svn r20545) -Codechange: make sure an OrderBackup gets cleared when the depot it belongs to gets removed, the depot window gets closed or when another vehicle gets sold in a depot 2010-08-18 18:52:16 +00:00
rubidium 287ee8c01d (svn r20541) -Fix: when removing a vehicle update the "clone orders of"-vehicle of a backed up order, or remove it if there is no vehicle sharing orders with that vehicle. 2010-08-18 15:58:30 +00:00
rubidium 38ca44594f (svn r20539) -Codechange: make order backups more self-contained. 2010-08-18 15:15:59 +00:00