Commit Graph

204 Commits

Author SHA1 Message Date
Jonathan G Rennison
bea66c4beb Fix minor code style issue 2024-06-30 19:12:08 +01:00
Jonathan G Rennison
f2f8692fb2 Add setting to allow track editing to ignore realistic braking restrictions 2024-05-28 17:13:09 +01:00
Jonathan G Rennison
fe730bce31 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/codeql.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-windows.yml
#	src/map.cpp
#	src/music/midifile.hpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/pbs.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/script/api/script_text.cpp
#	src/ship_cmd.cpp
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_func.h
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/viewport.cpp
#	src/waypoint_cmd.cpp
2024-03-12 17:44:28 +00:00
Rubidium
27eadc13ec Codechange: rename TILE_ADD(XY) to TileAdd(XY) 2024-03-10 15:50:24 +01:00
Jonathan G Rennison
b4b61beeec Fix slot acquire on PBS reservation end on tunnel/bridge entrance signals 2024-01-30 18:31:44 +00:00
Jonathan G Rennison
24fc4e3e3f Tracerestrict: Remove TRPISP_PBS_RES_END_RELEASE 2024-01-20 22:24:19 +00:00
Jonathan G Rennison
7d1e350b94 Tracerestrict: Handle slot acquire on tunnel/bridge entrance reserve
When using realistic braking
Using the same context as PBS end acquire/release
2024-01-20 22:20:51 +00:00
Jonathan G Rennison
9e8a43144a Tracerestrict: Handle slot acquire and wait at PBS on intermediary reservation signals
Wait at PBS is applied as if on the starting signal
2024-01-20 20:42:13 +00:00
Jonathan G Rennison
97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
2024-01-07 17:20:41 +00:00
Jonathan G Rennison
38df621e62 Improve train speed adaptation with realistic braking
Take into account recorded speeds at signals along the reservation
As noted in the lookahead

See: #613
2023-11-25 00:23:27 +00:00
Jonathan G Rennison
c929f7075e Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/SourceList.cmake
#	src/build_vehicle_gui.cpp
#	src/company_gui.cpp
#	src/console_cmds.cpp
#	src/depot_base.h
#	src/elrail.cpp
#	src/network/core/udp.cpp
#	src/network/network_admin.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/newgrf.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_railtype.cpp
#	src/newgrf_railtype.h
#	src/newgrf_storage.h
#	src/os/unix/crashlog_unix.cpp
#	src/rail.h
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/road_cmd.cpp
#	src/road_map.h
#	src/saveload/labelmaps_sl.cpp
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/sl/oldloader_sl.cpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/table/settings/world_settings.ini
#	src/tests/test_script_admin.cpp
#	src/textfile_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_cmd.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/window.cpp
#	src/window_gui.h
#	src/window_type.h
2023-11-19 13:00:21 +00:00
Jonathan G Rennison
1183476182 Allow custom signal styles to disable aspect-limited mode
By setting style_lookahead_extra_aspects to 255
2023-08-14 23:56:21 +01:00
Jonathan G Rennison
4f875012b6 Do not unnecessarily extend train reservations when passing signal
When the signal is a next-only or non-aspect-incrementing type, and
its maximum lookahead is not beyond the current end of the reservation
2023-07-23 18:39:57 +01:00
Jonathan G Rennison
09e03fb6b2 Change TunnelBridgeIsFree across_only to a mode enum type 2023-05-06 16:19:52 +01:00
Jonathan G Rennison
9521e7ef2b Merge branch 'master' into jgrpp
# Conflicts:
#	src/elrail.cpp
#	src/ground_vehicle.hpp
#	src/landscape.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/tile_cmd.h
#	src/town_cmd.cpp
#	src/tunnelbridge_cmd.cpp
2023-04-12 19:34:11 +01:00
Jonathan G Rennison
4ec6a99dd8 Add GetTileTrackStatus wrapper for when red signals part is not needed 2023-03-04 02:01:40 +00:00
Jonathan G Rennison
3e7a625e0e Fix function locals shadowing parameters 2023-02-16 00:09:14 +00:00
Jonathan G Rennison
07b7cc5652 Tracerestrict: Add condition whether reservation passes through tile 2023-02-06 19:54:14 +00:00
Tyler Trahan
c19abebf8d Feature: Multi-track level crossings (#9931) 2022-11-01 16:51:23 -04:00
Jonathan G Rennison
bd28d5a239 Use order state at reservation time for signal mode tracerestrict eval 2022-07-01 00:33:59 +01:00
Jonathan G Rennison
6a69a5495f Add tracerestrict action to set combined normal/shunt signal mode
Add associated conditional to get reservation end tile
2022-06-28 01:16:57 +01:00
Jonathan G Rennison
78ae295dfe Add combined normal and shunt aspect signal style flag 2022-06-27 18:51:26 +01:00
Jonathan G Rennison
2f7664fc93 Move signal style mask variables into a single struct 2022-06-25 10:18:48 +01:00
Jonathan G Rennison
a311f12615 Add signals_style_lookahead_single_signal_only signal style property 2022-06-25 01:29:08 +01:00
Jonathan G Rennison
24e965061c Fix limit train lookahead to signal aspect when starting
From depot and within signal sighting distance (e.g. reverse)
2022-06-25 01:17:24 +01:00
Jonathan G Rennison
3a064f127b Fix SetTrainReservationLookaheadEnd moving end nearer 2022-06-22 18:50:41 +01:00
Jonathan G Rennison
b6e099121a Fix limit train lookahead to signal aspect within signalled tunnel/bridges 2022-06-22 00:24:13 +01:00
Jonathan G Rennison
175c5d4d50 Add signal style flag to limit lookahead extra aspect 2022-06-19 12:46:56 +01:00
Jonathan G Rennison
22caac6529 Add game setting to limit train lookahead to signal aspect
In realistic braking mode when multi-aspect signalling enabled by GRF
2022-06-19 12:44:15 +01:00
Jonathan G Rennison
bdd73a19a1 Add signal style flag for unconditional reserve through
Add map bits for unconditional reserve through
Adjust signal aspect/state handling
2022-06-19 04:15:27 +01:00
Jonathan G Rennison
02dabad81e Tracerestrict: Add flag for whether reserve through is always set 2022-06-11 16:40:32 +01:00
Jonathan G Rennison
99ee4b13ce Realistic braking: Cache train overall z position
Refresh cache at a variable rate depending on train length and
weight distribution
2022-06-03 00:41:41 +01:00
Jonathan G Rennison
502980ba61 Support railtype-dependant GRF train speed limits with realistic braking
See: #389
2022-05-24 21:50:38 +01:00
Jonathan G Rennison
551560537f Ensure that adjacent level crossings cannot leave map if there are no void tiles 2021-11-20 01:27:41 +00:00
Jonathan G Rennison
74bfe4e6d2 Allow placing routing restrictions on tunnel/bridge entrance/exit signals
No reserve through support
2021-11-13 22:28:14 +00:00
Jonathan G Rennison
48977853a4 Simplify some rail/signalled tunnel/bridge tile checks 2021-11-13 17:26:07 +00:00
Jonathan G Rennison
dad007e16a Fix spelling of TRPRF_SPEED_RESTRICTION_SET 2021-11-13 02:00:37 +00:00
Jonathan G Rennison
3308edf792 Try to extend reservation when passing sighting distance of non-end signal 2021-11-12 01:02:29 +00:00
Jonathan G Rennison
5d351a14d2 Add new signal type: no-entry signal
This is only passable in one direction, but does not have a signal
or show an aspect in the opposite direction

Add a setting for whether this is shown in the signal UI.
Off by default.
2021-09-04 11:39:54 +01:00
Jonathan G Rennison
b2ef6c0de8 Add implementation of multi-aspect signalling and GRF support
Requires realistic braking

See: #247
2021-08-28 12:54:18 +01:00
Jonathan G Rennison
55c4fe7d45 Add helper functions to get tunnel/bridge entrance/exit trackdirs 2021-08-27 23:39:20 +01:00
Jonathan G Rennison
1002c6d9d2 Fix various compiler warnings
See: #267
2021-06-11 22:54:27 +01:00
Jonathan G Rennison
ba2e6087b2 Add train cache flag for whether train using realistic braking physics 2021-04-15 20:56:45 +01:00
Jonathan G Rennison
b514d29db1 Replace TrainCache::cached_tilt with a flags field 2021-04-15 20:56:45 +01:00
Jonathan G Rennison
8fd4f65a85 Validate lookahead reservation end OK before calling FollowTrainReservation 2021-04-01 00:36:13 +01:00
Jonathan G Rennison
5b5e068e52 Don't check safe waiting point in FollowTrainReservation if result unused 2021-03-31 22:39:44 +01:00
Jonathan G Rennison
5c569b1880 Validate TB exit tile when TRLF_TB_EXIT_FREE set in FollowTrainReservation 2021-03-30 23:10:26 +01:00
Jonathan G Rennison
8646506127 Prevent lookahead init for wrong way movement on signalled tunnel/bridge 2021-03-30 22:53:45 +01:00
Jonathan G Rennison
b9413ea250 Remove assert from UpdateSignalsOnSegment that globset is empty
Just do the right thing if it isn't empty instead of asserting
2021-03-17 20:35:48 +00:00
Jonathan G Rennison
fb64e29c6c Fix assertion failure when command triggers PBS tunnel/bridge unreserve
In the case where the signal update buffer is not currently empty
2021-03-16 03:23:00 +00:00