Michael Lutz
7e906c7c59
Change: Preserve orders and related settings where possible when moving engines around in a train.
1 year ago
Michael Lutz
07449be876
Codechange: A vehicle that is not a front engine can't be removed from a vehicle group, so just remove a pointless function call.
1 year ago
Jonathan G Rennison
8d501f2db1
Fix #10741 : Rail platforms left partially reserved after train crash ( #10751 )
1 year ago
Peter Nelson
4a5e413a6c
Cleanup: Remove unnecessary VehicleRandomBits()
...
Simple Random() assignment to byte does the same.
1 year ago
Rubidium
f74e26ca7e
Codechange: replace error/usererror printf variant with fmt variant and rename
1 year ago
Patric Stout
7aa2b9ab0a
Codechange: move all date-related variables inside the timer ( #10706 )
1 year ago
Rubidium
e8af8daa68
Codechange: pass "ground vehicle" to GetTileSlopeZ since for tunnel/bridges there are two states
...
Previously it checked the position in non-driving direction to "guess" whether
a ground vehicle was using the function, so on tunnels/bridges it could either
return the Z of the (virtual) ground compared to the Z of the path the vehicle
would take.
2 years ago
SamuXarick
b52b29b1a4
Change: Avoid crashing to the side of a train
...
When a road vehicle is already running on a multi level crossing, and a train shows up ahead, don't make the road vehicle crash on the side of the train.
2 years ago
rubidium42
6ba55e663e
Codechange: do not hide variables with other variables
2 years ago
Rubidium
fe2bcd2a58
Codechange: migrate size related functions to Map structure
2 years ago
Rubidium
375a5b8e3f
Codechange: refactor FindClosestDepot to not use pointers, but return a struct
2 years ago
PeterN
7b5edba76c
Change: Support flipping shorter engines without NewGRF support. ( #10262 )
...
* Change: Support flipping shorter engines without NewGRF support.
* Cleanup: Remove write-only prop27_set temporary flag.
2 years ago
Peter Nelson
ed60c88b0a
Change: Use power-of-2 scaling for some dimensions in GUI.
...
These are related to drawing sprites that are normally drawn on the
landscape, and should therefore still follow power-of-2 scaling to fit
correctly.
2 years ago
Peter Nelson
f5f035a22b
Codechange: Make use of Rect Width/Height helpers.
2 years ago
Artin Alavi
fd4f148c62
Feature: Hotkey to honk a vehicle's horn ( #10110 )
2 years ago
Henry Wilson
59dbcdb5ba
Feature: Display power-to-weight ratio in ground vehicle details GUI
2 years ago
Tyler Trahan
c19abebf8d
Feature: Multi-track level crossings ( #9931 )
2 years ago
Nicolas Chappe
721d98a7d0
Feature: Constantly update destination of 'any depot' orders
2 years ago
Nicolas Chappe
a4052ca348
Codechange: Add VehicleOrderSaver::Restore()
2 years ago
Nicolas Chappe
7e7d943526
Codechange: [YAPF] Allow to retrieve the final tile of the calculated path
2 years ago
Nicolas Chappe
a9a21e784d
Codechange: Always set the ODATFB_NEAREST_DEPOT flag for 'any depot' orders
2 years ago
Bouke Haarsma
bda602f4b0
Fix: reduce framerate overhead on train ticks
...
Tick() is a noop for all but front-engine / crashed vehicles. Starting a framerate is rather cheap, but not free, and introduces a lot of overhead for such close loops.
2 years ago
Patric Stout
979704271b
Fix: reverse train direction command did not validate the given vehicle properly ( #9947 )
...
You could give a wagon in the chain to reverse (which makes no
functional sense ofc). In result, only parts of the vehicle were
reversing, leading to weird crashes.
2 years ago
Niels Martin Hansen
e68bf58989
Codechange: Use anonymous union for vehicle orders/old orders list
3 years ago
Michael Lutz
41fa16f325
Codechange: Don't use globals for return values from vehicle command procs.
3 years ago
Michael Lutz
13528bfcd0
Codechange: Un-bitstuff all remaining commands.
3 years ago
Michael Lutz
21675ec7e2
Codechange: Un-bitstuff vehicle/engine commands.
3 years ago
Michael Lutz
4f3ea3907e
Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID).
3 years ago
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.
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
549caca39c
Codechange: Move command arguments to the back of the networked command function calls.
3 years ago
Michael Lutz
b6933a2ebd
Codechange: Move command arguments to the back of the DoCommand function call.
3 years ago
Patric Stout
7acdaaaf2f
Fix: Prevent train reversing when wholly inside a train depot ( #9557 )
...
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
3 years ago
Michael Lutz
ee333a9549
Fix 2183fd4d: [NewGRF] Use divide instead of right shift for signed numbers. ( #9480 )
...
"For negative a, the value of a >> b is implementation-defined (in most implementations, this performs arithmetic right shift, so that the result remains negative)."
3 years ago
Vít Šefl
2183fd4dab
Feature: [NewGRF] Maximum curve speed modifier for rail vehicles ( #9346 )
3 years ago
glx22
49b66ea504
Codechange: Remove FOR_EACH_SET_TRACK
3 years ago
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
3 years ago
rubidium42
2e136285e1
Codechange: move from C-string to std::string for DoCommand
3 years ago
rubidium42
b791ffc6de
Fix: do not hide parameter by local variable with the same name
3 years ago
Jonathan G Rennison
a896753ecc
Fix #9264 : Do not attach temporary wagons to free wagon chains when autoreplacing
3 years ago
rubidium42
44ca7d9377
Change: Use gender-neutral pronouns
3 years ago
frosch
d9b4413bc9
Codechange: rename sound ids to make more sense. ( #8701 )
4 years ago
Patric Stout
cd36e17160
Fix: don't allow free-wagon-chains to exceed max-train-length ( #8533 )
...
This makes no sense, that a free-wagon-chain could be larger than
the maximum length of a train, as you cannot put an engine in
front of that anyway. And it prevents run-away AIs making very
silly long free-wagon-chains.
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
Patric Stout
dff7ee8e1c
Fix #7611 : keeps news about accidents around after vehicle is cleaned up ( #8497 )
...
When a vehicle is cleaned up, all news that points to the news is
also removed. This was a bit evil, as it would also remove any
news related to crashed, acting like the crash never happened.
This left players a bit in the dark what was going on exactly.
4 years ago
Matt Kimber
9b28b15e67
Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods
4 years ago
Andy
0f91cb0479
Fix: GetCurveSpeedLimit needs railtype from current tile ( #8466 )
4 years ago
glx
d8a1be48cd
Codechange: Replace vehicle related FOR_ALL with range-based for loops
5 years ago