Michael Lutz
d5fc423793
Fix #10223 : Crash when vehicle cloning fails on order cloning.
2022-12-08 00:09:12 +01:00
Patric Stout
055121df80
Fix: depot-related commands did not validate depot tiles properly ( #9948 )
...
The bug comes in two slices:
1) the functions never actually checked if "tile" was a depot tile.
This allowed executing the function on tile 0, where are the
things like shadows of aircrafts are.
2) BuildDepotVehicleList() first checked if a vehicle is in a depot
before checking if it was a primary vehicle. This is invalid
for aircraft.
Fixing the first hides the second, and fixing the second makes the
first non-exploitable. But, fixing both felt like the best thing
to do.
2022-07-09 12:28:09 +02:00
Niels Martin Hansen
e68bf58989
Codechange: Use anonymous union for vehicle orders/old orders list
2022-02-15 20:01:10 +01:00
J0anJosep
d9a37c915f
Cleanup #9725 : Replace cmd_helper related functions and remove cmd_helper.h.
2022-02-02 21:30:15 +01:00
Joan Josep
e890e7db76
Cleanup #9725 : Clean up Doxygen docs and fix typo. ( #9753 )
2021-12-19 16:51:45 +01:00
Michael Lutz
41fa16f325
Codechange: Don't use globals for return values from vehicle command procs.
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
21675ec7e2
Codechange: Un-bitstuff vehicle/engine 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
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
b6933a2ebd
Codechange: Move command arguments to the back of the DoCommand function call.
2021-12-16 22:28:32 +01:00
SamuXarick
76b8343777
Fix #9392 : Return a valid value with GetBuildWithRefitCapacity when AIs are maxed out in vehicles ( #9393 )
2021-08-11 19:21:34 +02:00
Rubidium
d31a535c87
Cleanup: remove some unneeded c_str() calls
2021-06-15 06:13:00 +02:00
rubidium42
2e136285e1
Codechange: move from C-string to std::string for DoCommand
2021-05-29 19:02:18 +02:00
rubidium42
661728558e
Codechange: let IsUnique.* functions accept std::string
2021-05-29 19:02:18 +02:00
Patric Stout
9a3dbf3122
Fix 02e770ff: allow estimating CloneVehicle if short on money ( #8748 )
...
CheckCompanyHasMoney() was also executed when not using DC_EXEC,
resulting in an error about shortage of money instead of the
estimation.
This mostly is a problem for AI players, as they will have no
way to know how much it would have cost.
2021-02-26 16:22:58 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
2021-01-08 11:16:18 +01:00
Patric Stout
725d793be1
Fix: don't allow cloning vehicles if cloning orders is failing ( #8515 )
...
Before this fix, any failing clone order was silently ignored
and you as user would never know till you checked the order list.
Evil.
2021-01-07 19:58:04 +01:00
Michael Lutz
63ccb36ef3
Codechange: Use std::string for most of the user-settable custom names.
2020-05-21 20:02:34 +02:00
frosch
9f2e23d8ba
Fix #8093 : Build+Refit changed game-state in command test run, and thus caused desyncs.
...
Use DC_AUTOREPLACE for actions that shall be reversibe, in this case:
- Do not rearrange free wagons in test-run.
- Do not discard OrderBackups.
The latter was not triggered by actual auto-replace, since it does not set a 'user'.
2020-05-03 23:18:30 +02:00
frosch
0f9dc88834
Fix: When build+refit an engine, do not refit any free wagons that may get attached.
2020-05-03 23:18:30 +02:00
frosch
68244393f1
Codechange: Unify the tests whether build+refit is in simulation-test or real-run.
2020-05-03 23:18:30 +02:00
glx
d8a1be48cd
Codechange: Replace vehicle 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
Charles Pigott
73a2cee779
Fix: Quiet a bogus -Wmaybe-unitialized warning from GCC9
2019-09-30 14:00:06 +01:00
stormcone
2e686ad5d5
Fix #7667 : Buying an engine after buying wagons doesn't give a complete train.
2019-07-23 23:15:08 +02:00
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
2019-04-10 23:22:20 +02:00
peter1138
8114bad033
Fix #7469 : Desync when using build and refit feature.
2019-04-04 23:29:43 +01:00
Charles Pigott
e453572b6a
Codechange: Initialise a few variables that -flto seems to think could possibly be uninitialised
2019-03-26 20:54:40 +00:00
Henry Wilson
c01a2e2a81
Codechange: Removed SmallVector completely
2019-03-26 20:15:57 +00:00
Henry Wilson
ab711e6942
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
2019-03-26 20:15:57 +00:00
Henry Wilson
5795f66d2e
Codechange: Replaced SmallVector::Contains() with std::find() pattern
2019-03-26 20:15:57 +00:00
Henry Wilson
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
2019-03-26 20:15:57 +00:00
Henry Wilson
bfd79e59dc
Codechange: Replace SmallVector::Clear() with std::vector::clear()
2019-03-26 20:15:57 +00:00
peter1138
e6bb90543e
Change: Show additional cost and refitted capacity in build vehicle window.
2019-03-24 15:28:48 +00:00
peter1138
d54b6ac09b
Feature: When filtering purchase list by cargo type, make buy button perform a refit if required.
2019-03-24 15:28:48 +00:00
PeterN
d242875d27
Fix #7197 : Invalidate depot buttons when necessary. ( #7212 )
2019-02-10 08:43:54 +00:00
Peter Nelson
48fb575502
Fix 11ab3c4ea2f: Vehicles could not be refitted to cargo IDs higher than 32.
2019-01-29 17:57:28 +00:00
Niels Martin Hansen
c84b9913bd
Fix #6676 : Prevent helicopters from stopping in midair during some kinds of landing
...
This adds a new flag that gets stored in the savegame, but it should still be compatible both ways, hence no save version bump.
2018-11-25 00:47:34 +01:00
Charles Pigott
f5b1115039
Doc: Lots and lots of doxymentation fixes
2018-10-31 12:35:54 +01:00
Joan Josep
944f785be8
Fix: Spelling errors ( #6769 )
2018-04-30 18:52:32 +02:00
frosch
476b2b0e8c
(svn r27677) -Codechange: Remove implicit VehicleListIdentifier from uint32 constructor, to make conversions more explicit.
2016-11-05 19:16:59 +00:00
frosch
0974f5489b
(svn r27428) -Fix: When selecting a refit cargo for orders, do not check whether the vehicle is in a depot or station, and do not ask whether the vehicle currently allows station-refitting. Also hide the refit cost for orders, it is not predictable.
2015-10-30 17:27:21 +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
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