Commit Graph

359 Commits

Author SHA1 Message Date
merni-ns 55a7c59d13 Remove: NPF and pathfinder change settings 2024-05-10 10:38:44 +02:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
SamuXarick d7c5e9e8ab Codechange: Where the ship comes from is already known
This simplifies the handling of variables.

`ChooseShipTrack` is called upon entering `tile`, and looking further back to the caller, it can be deduced that `v->tile` matches `src_tile`. With that said, `enterdir` can also be removed, as it's not used anywhere else.

`CreateRandomPath` and `GetRandomFollowUpTrackdir` is being fed `src_tile` as it's 2nd parameter. This could be eliminated, as `v` is also being passed to it. Just use `v->tile` in those functions.
2024-03-16 17:02:19 +01:00
Rubidium 27eadc13ec Codechange: rename TILE_ADD(XY) to TileAdd(XY) 2024-03-10 15:50:24 +01:00
Tyler Trahan 32b0fb9f6e
Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142) 2024-03-09 09:38:52 -05:00
Peter Nelson b2ca6e1ac8
Codefix: Remove no-longer used ship special-case. (#12192)
This special-case has not been triggered since multi-tile docks were introduced.
2024-03-03 09:31:04 +00:00
SamuXarick b22fb43cea
Fix #10490: Allow ships to exit depots if another is not moving at the exit point (#12161) 2024-02-23 08:08:16 -05:00
Peter Nelson 2fd9096070
Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
2024-02-04 10:16:08 +00:00
Tyler Trahan f6dd5053a3
Feature: Order flag to unbunch vehicles at depot (#11945) 2024-02-03 08:04:24 -05:00
Koen Bussemaker 5a55c4a934 Feature: [NewGRF] Allow higher max speeds for ships 2024-01-28 14:54:51 +01:00
Kuhnovic 8a4a99b7e8
Fix #5713: FindClosestShipDepot only considers depots that are actually reachable (#11768) 2024-01-27 15:06:14 +01:00
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
frosch baf7cc858b Codechange: Rename ship docking tile related functions. 2023-09-19 22:49:59 +02:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 2023-09-10 08:40:25 -04:00
Tyler Trahan fca2b37726 Codechange: Move Ticks into their own class 2023-09-10 08:40:25 -04:00
Tyler Trahan 9a602ff304
Fix #10334: Store separate newgrf-safe version of date_of_last_service. (#11124)
This value is not changed when the date cheat is used, which caused issues with changing properties based on service date.

Co-authored-by: Peter Nelson <peter1138@openttd.org>
2023-08-06 12:57:10 -04:00
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
Peter Nelson 4a5e413a6c Cleanup: Remove unnecessary VehicleRandomBits()
Simple Random() assignment to byte does the same.
2023-05-04 21:42:28 +01:00
Kuhnovic 3991e76c96
Fix #8177: Ships with max speed overflow to near-zero speed (#10695) 2023-04-29 09:33:01 +01:00
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
Rubidium 375a5b8e3f Codechange: refactor FindClosestDepot to not use pointers, but return a struct 2023-01-04 22:30:48 +01:00
Peter Nelson f5f035a22b Codechange: Make use of Rect Width/Height helpers. 2022-11-12 18:28:39 +00:00
Artin Alavi fd4f148c62
Feature: Hotkey to honk a vehicle's horn (#10110) 2022-11-10 21:36:18 +01:00
Niels Martin Hansen 588fee5473 Codechange: Document the _ship_subcoord table 2022-05-06 22:56:01 +02: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 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 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
glx22 cbe00ec651 Fix: Try all possible reverse directions when a ship reaches a dead end 2021-10-11 21:11:13 +02:00
glx22 207cf7bbdd Change: Reverse ship when leaving docks if a better path exists 2021-10-11 21:11:13 +02:00
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
Tyler Trahan ce06b03fac
Fix: Stopped ships shouldn't block depots (#8578) 2021-02-14 23:42:29 +01:00
Matt Kimber 40d5fe1631
Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds (#8540) 2021-01-17 19:57:16 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Matt Kimber 9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 2021-01-05 11:42:25 +01:00
SamuXarick 57553cd809 Fix #8020: Add missing docking tiles around industry neutral stations 2020-03-30 08:21:40 +02:00
Samu a0066ebca1 Cleanup: Remove unused parameter 2020-01-06 23:20:35 +00:00
glx fa9769f81a Codechange: Replace FOR_ALL_DEPOTS 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
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
peter1138 ec2656ab7e Codechange: Restrict docking points of docks. 2019-06-30 16:46:32 +02:00
peter1138 f538179878 Feature: Multi-tile docks and docking points. 2019-06-30 16:46:32 +02:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Samu fb6e31ca43 Cleanup 3f32711: Don't apply forbid 90 deg turn settings for ships. 2019-04-05 10:03:54 +01:00
peter1138 66bed86bbb Fix #7062, Revert 7af53d7588: Don't test ship max order distance when pathfinding. 2019-03-31 17:22:54 +01:00
Charles Pigott fe448a2616 Remove: OPF 2019-03-16 22:30:11 +00:00
peter1138 a69eb5f516 Fix #7334: Ship lost after crossing bridge due to path cache not being consumed while on final bridge end. 2019-03-08 16:51:23 +01:00
Peter Nelson 3f327116db Change: Don't apply forbid 90 deg turn settings to ships. 2019-03-03 20:59:44 +01:00
J0an Josep c4fe46a475 Fix #7244, 6ca637b8c1: OPF doesn't take 90 deg turns into account. 2019-02-19 01:06:10 +01:00