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
1 year ago
PeterN
2a2443dd01
Feature: Create group of vehicles from manage vehicle list button. ( #10890 )
1 year ago
PeterN
2097719f26
Fix: Don't restore backed up vehicle name if it's no longer unique. ( #10979 )
1 year ago
PeterN
ee2d0745e9
Fix #10502 : Refit engine before attaching free wagons. ( #10926 )
...
Caused by incorrect order of operations when buying a train engine with refit and attaching free wagons.
1 year ago
Peter Nelson
f177ce7c9a
Codechange: Base CargoArray off std::array.
...
This avoids needing to define array accessors and allows use of
default value initialization.
1 year ago
Peter Nelson
76516d7f70
Codechange: Use IsValidCargoID/IsValidCargoType.
...
IsValidCargoType() is used only for unmapped IDs.
1 year ago
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.
2 years ago
Jonathan G Rennison
10e76b2788
Fix #10032 : Capacities of articulated vehicles in build window
...
See also: #9954
2 years ago
Michael Lutz
d5fc423793
Fix #10223 : Crash when vehicle cloning fails on order cloning.
2 years ago
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.
2 years ago
Niels Martin Hansen
e68bf58989
Codechange: Use anonymous union for vehicle orders/old orders list
3 years ago
J0anJosep
d9a37c915f
Cleanup #9725 : Replace cmd_helper related functions and remove cmd_helper.h.
3 years ago
Joan Josep
e890e7db76
Cleanup #9725 : Clean up Doxygen docs and fix typo. ( #9753 )
3 years ago
Michael Lutz
41fa16f325
Codechange: Don't use globals for return values from vehicle command procs.
3 years ago
Michael Lutz
e08b3abe7f
Codechange: Un-bitstuff group and autoreplace commands.
3 years ago
Michael Lutz
21675ec7e2
Codechange: Un-bitstuff vehicle/engine commands.
3 years ago
Michael Lutz
211c630cbe
Codechange: Un-bitstuff order commands.
3 years ago
Michael Lutz
4f3ea3907e
Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID).
3 years ago
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.
3 years ago
Michael Lutz
7048e1522f
Codechange: Move flags in CommandProc in front of the command arguments.
3 years ago
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.
3 years ago
Michael Lutz
a38bbefe1b
Codechange: Untangle command code, flags and error string for DoCommand*.
3 years ago
Michael Lutz
b6933a2ebd
Codechange: Move command arguments to the back of the DoCommand function call.
3 years ago
SamuXarick
76b8343777
Fix #9392 : Return a valid value with GetBuildWithRefitCapacity when AIs are maxed out in vehicles ( #9393 )
3 years ago
Rubidium
d31a535c87
Cleanup: remove some unneeded c_str() calls
3 years ago
rubidium42
2e136285e1
Codechange: move from C-string to std::string for DoCommand
3 years ago
rubidium42
661728558e
Codechange: let IsUnique.* functions accept std::string
3 years ago
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.
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
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.
4 years ago
Michael Lutz
63ccb36ef3
Codechange: Use std::string for most of the user-settable custom names.
4 years ago
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'.
4 years ago
frosch
0f9dc88834
Fix: When build+refit an engine, do not refit any free wagons that may get attached.
4 years ago
frosch
68244393f1
Codechange: Unify the tests whether build+refit is in simulation-test or real-run.
4 years ago
glx
d8a1be48cd
Codechange: Replace vehicle related FOR_ALL with range-based for loops
5 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
Charles Pigott
73a2cee779
Fix: Quiet a bogus -Wmaybe-unitialized warning from GCC9
5 years ago
stormcone
2e686ad5d5
Fix #7667 : Buying an engine after buying wagons doesn't give a complete train.
5 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
6 years ago
peter1138
8114bad033
Fix #7469 : Desync when using build and refit feature.
6 years ago
Charles Pigott
e453572b6a
Codechange: Initialise a few variables that -flto seems to think could possibly be uninitialised
6 years ago
Henry Wilson
c01a2e2a81
Codechange: Removed SmallVector completely
6 years ago
Henry Wilson
ab711e6942
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
6 years ago
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
6 years ago
Henry Wilson
5795f66d2e
Codechange: Replaced SmallVector::Contains() with std::find() pattern
6 years ago
Henry Wilson
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
6 years ago
Henry Wilson
bfd79e59dc
Codechange: Replace SmallVector::Clear() with std::vector::clear()
6 years ago
peter1138
e6bb90543e
Change: Show additional cost and refitted capacity in build vehicle window.
6 years ago
peter1138
d54b6ac09b
Feature: When filtering purchase list by cargo type, make buy button perform a refit if required.
6 years ago
PeterN
d242875d27
Fix #7197 : Invalidate depot buttons when necessary. ( #7212 )
6 years ago