Commit Graph
789 Commits
Author SHA1 Message Date
Peter NelsonandGitHub d54341318e Fix: VF_LOADING_FINISHED and VF_STOP_LOADING flags tested on wrong vehicle part. (#13063)
These flags are only set on the front part of a vehicle as they apply to the whole consist.
2024-11-07 00:25:05 +00:00
SamuXarickandGitHub a86f9dba0f Codefix: Correct handling of GetDepotOrderType() comparison (#13023)
In the function where we check the depot order type, using `!=` with GetDepotOrderType() is not ideal because the function can return flag bits.
2024-10-27 18:47:22 +01:00
Peter NelsonandGitHub 376e882a14 Codechange: Add HasFlag() to test if a value is present in a bitset enum type. (#12959)
This simplifies tests for `(x & y) != y` with enum classes by reducing repetition, similar to HasBit(), and also makes the intent of the expression clearer.
2024-09-22 14:51:37 +01:00
Jonathan G Rennisonandrubidium42 9c84e5df3f Add: Road waypoint functionality 2024-06-24 22:12:08 +02:00
merni-nsandGitHub 0409577277 Add: Setting to disable warning for old vehicles (#12714) 2024-06-15 17:14:29 -04:00
Peter NelsonandGitHub 8d26d032e1 Fix #12497: [NewGRF] Increase vehicle motion counter for all parts. (#12561)
NewGRFs relied on the incorrectly motion counter that was 'fixed' in #12229, so always update v->motion_counter for all vehicle parts.
2024-05-17 20:50:04 +01:00
Tyler TrahanandGitHub 78b83190cc Fix: Mark vehicle status bars dirty when a vehicle leaves unbunching depot (#12516) 2024-04-18 12:45:00 -04:00
Tyler TrahanandGitHub 5878d09ef2 Fix: Smooth outliers in unbunching round trip calculations (#12513) 2024-04-17 15:03:53 -04:00
Tyler TrahanandGitHub 824687d1f0 Codefix: Don't mix signed and unsigned ints in unbunching calculations (#12514) 2024-04-17 14:42:49 -04:00
Peter NelsonandGitHub ef8eb66a2b Fix c38df2d58: Use VehicleID instead of pointer in map of vehicles to replace. (#12512)
This affects the sort order, VehicleID is deterministic, Vehicle * is not.
2024-04-17 18:54:50 +01:00
Peter NelsonandPeter Nelson 9854553e10 Codechange: ZOOM_LVL_SHIFT/BASE are not actually ZOOM_LVLs.
Rename to ZOOM_BASE_SHIFT and ZOOM_BASE respectively, and derive from ZOOM_LVL instead of numeric value.
2024-04-04 22:27:03 +01:00
Jonathan G RennisonandGitHub 433484cda3 Fix #12388: Vehicle::CopyVehicleConfigAndStatistics not releasing unit number (#12389) 2024-03-27 21:20:27 +01:00
Peter NelsonandGitHub 737e3feaf0 Codechange: Don't delete news items or NewGRF window when EffectVehicle is deleted. (#12334)
EffectVehicles never create news and can't be debugged, so searching for news items and windows to delete just wastes time.
2024-03-18 23:39:42 +00:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidiumandrubidium42 bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 2024-03-10 10:14:20 +01:00
Tyler TrahanandGitHub 32b0fb9f6e Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142) 2024-03-09 09:38:52 -05:00
Tyler TrahanandGitHub ab315d0dc9 Fix #12118: When adding an unbunching order, properly check for unsafe conditions (#12136) 2024-03-09 08:28:05 -05:00
Tyler TrahanandGitHub 5806c2aba4 Fix #12203: When unbunching at a depot, don't overlook implicit orders (#12220) 2024-03-08 10:19:50 -05:00
Peter NelsonandGitHub a9de766fa6 Fix: Train running sounds should only be produced for engine parts. (#12229) 2024-03-08 14:23:48 +01:00
Tyler TrahanandGitHub 3fd5c33ae6 Fix f6dd505: Only reset unbunching departure data in the correct depot (#12155) 2024-03-01 21:29:55 +00:00
Peter NelsonandGitHub 56cf89d189 Change: Use bitmap for free unit ID generation. (#12165)
This improves performance of finding the next free unit number for a vehicle.

Based loosely on pool's used slot bitmap.
2024-02-25 12:36:13 +00:00
Peter NelsonandGitHub df691eb31e Codechange: Don't scan vehicle pool to find targeting disaster vehicle when deleting any vehicle. (#12064)
* Codechange: Don't scan vehicle pool to find targeting disaster vehicle when deleting any vehicle.

When deleting a vehicle, the vehicle pool is scanned to find a targetting disaster vehicle. With lots of vehicles this can take some time, especially when deleting multiple consecutive vehicles.

Disasters vehicles can actually only target road vehicles. Store the DisasterVehicle index in the road vehicle, so that no pool scan is necessary.

* Change: Small UFOs no longer target a vehicle which is already a target.
2024-02-11 23:04:29 +00:00
Peter NelsonandGitHub 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 TrahanandGitHub f6dd5053a3 Feature: Order flag to unbunch vehicles at depot (#11945) 2024-02-03 08:04:24 -05:00
froschandfrosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
merni-nsandGitHub 5a88027a19 Feature: Infinite money mode (#11902) 2024-01-30 18:01:02 +00:00
froschandfrosch 68c64d2511 Codechange: Remove TKM string codes by duplicating strings. 2024-01-28 14:44:24 +01:00
Tyler TrahanandGitHub fd9e72a7e7 Feature: Use real-time "wallclock" timekeeping units (#11341) 2024-01-23 11:36:09 -05:00
Tyler TrahanandGitHub 735abfe111 Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
Peter NelsonandPeter Nelson 952d111b94 Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
2024-01-09 18:56:05 +00:00
Rubidiumandrubidium42 e3f49ee7a0 Codechange: coding style fixes 2024-01-04 16:23:54 +01:00
Peter NelsonandGitHub 3864902683 Codechange: Use vehicle viewport hash to find clicked vehicle. (#11675)
This avoids having to iterate all vehicles, which can be an performance improvement when there are many vehicles.
2024-01-03 18:36:34 +00:00
Tyler Trahan 2a62caa30b Codechange: Use Ticks for BaseConsist timetable fields 2023-12-11 07:12:45 -05:00
Tyler Trahan 1f41e773d6 Codechange: Use consistent name for bay road stops
As of #10494, this is how we describe original dead-end road stops.
2023-11-28 14:24:33 -05:00
Jonathan G RennisonandGitHub 9822fa6584 Fix: Trivial autoreplace of mixed cargo articulated engines (#11253)
Do not fail autoreplace/autorenew of mixed cargo articulated engines
due to an inability to refit to mixed cargoes, when no refit is
required because the target engine already has a suitable set of cargoes.
Notably, this allows autorenew (autoreplace to same engine type)
to succeed.
2023-11-20 14:16:28 +01:00
Peter NelsonandGitHub ab535c0a86 Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
2023-11-06 20:29:35 +00:00
Peter NelsonandGitHub 7d4a91ef9e Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
2023-11-03 21:21:00 +00:00
Rubidiumandrubidium42 c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +01:00
froschandfrosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Patric StoutandGitHub df400ef84a Fix: only count distance traveled in vehicles for cargo payment (#11283)
No longer you can utilize the free (and instant) labour of station
workers, transporting your cargo from one part of the station to
the other. No more!

Based on patch by dP.
2023-09-19 22:16:31 +02:00
PeterNandGitHub acd7d3c913 Codechange: Rename *Railtype* to *RailType* for consistency. (#11287) 2023-09-11 08:55:12 +00: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
Patric StoutandGitHub b0e73277d6 Codechange: remove loaded_at_xy from CargoPacket as it was unused (#11276) 2023-09-09 20:24:46 +01:00
Patric StoutandGitHub 299570b2c1 Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 2023-08-12 18:14:21 +00:00
Patric StoutandGitHub a9ed590ca7 Codechange: use TimerGameCalendar::Date for variables in linkgraph that are dates (#11187) 2023-08-12 16:02:38 +02:00
Patric StoutandGitHub b7acf9e50e Codechange: use TimerGameCalendar::Year and friends when working with years (#11188) 2023-08-12 16:02:31 +02:00
Tyler TrahanandGitHub c7b51a8c3a Codechange: Use proper date types in various places (#11177) 2023-08-11 13:32:42 +00:00
Tyler TrahanandGitHub e4fd99a33a Codechange: Use DateAtStartOfYear() instead of multiplying by DAYS_IN_LEAP_YEAR (#11174) 2023-08-11 08:18:59 -04:00
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