Commit Graph

108 Commits

Author SHA1 Message Date
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
Peter 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
Peter Nelson cc488ec6c9
Fix ddd609c: Reverse build probability callback was not called for articulated parts. (#11526) 2023-11-30 23:12:39 +00:00
Jonathan G Rennison 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 Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
2023-11-03 21:21:00 +00:00
Peter Nelson 2a88e0fab3 Codechange: Use bitmask instead of array for cargo consistency check.
We only need to know if a cargo type is accepted, not how much.
2023-10-19 17:03:25 +01: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 f177ce7c9a Codechange: Base CargoArray off std::array.
This avoids needing to define array accessors and allows use of
default value initialization.
2023-05-23 19:07:36 +01:00
Peter Nelson 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
2023-05-22 20:43:40 +01:00
Peter Nelson 4a5e413a6c Cleanup: Remove unnecessary VehicleRandomBits()
Simple Random() assignment to byte does the same.
2023-05-04 21:42:28 +01:00
Jonathan G Rennison 10e76b2788 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
2023-01-14 18:52:01 +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
glx b50d77b831 Fix #8064: Incorrect display of refit capacity 2020-04-06 16:21:30 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
peter1138 e6bb90543e Change: Show additional cost and refitted capacity in build vehicle window. 2019-03-24 15:28:48 +00:00
PeterN 4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 2018-05-21 22:08:39 +01:00
frosch d2393b4f6c (svn r27666) -Codechange: Pass vehicle sprites around using a struct VehicleSpriteSeq. 2016-10-16 14:57:56 +00:00
frosch d188d02384 (svn r27580) -Fix [FS#6395]: Set date of last service on construction also for wagons and articulated parts. 2016-05-22 11:45:03 +00:00
rubidium 6c2abf0930 (svn r26863) -Codechange: move a number of Vehicle* functions into the Vehicle class 2014-09-20 15:31:26 +00:00
alberth bc84c52b30 (svn r26849) -Fix[FS#6113]: Better display of refit information in articulated vehicles. 2014-09-18 19:53:22 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
rubidium 3947453277 (svn r25259) -Codechange: track capacities and usage of links 2013-05-19 14:22:04 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
yexo 1f0593e7ca (svn r24029) -Change: [NoAI] make AIEngine::IsArticulated return true if the articulated callback flag is set, don't try to run the callback. 2012-03-14 20:49:54 +00:00
frosch 5167f2be29 (svn r23965) -Fix [FS#5070]: Refittability should never depend on the current capacity of a vehicle. 2012-02-19 18:34:24 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain 0d929e877f (svn r23713) -Codechange: split VehicleMove() into two functions, to minimalize the work done where possible 2012-01-02 13:44:30 +00:00
rubidium 3d88c74389 (svn r23526) -Codechange: unify cargos vs cargoes 2011-12-15 21:56:00 +00:00
frosch f97fa89f1a (svn r23137) -Change: [NewGRF v8] New result format for callback 16. 2011-11-08 17:22:49 +00:00
frosch acc3c75951 (svn r23075) -Codechange: Add GetGRF() and GetGRFID() methods to Engine and Vehicle to simplify code. 2011-11-01 00:23:41 +00:00
frosch 72cd855978 (svn r23074) -Codechange: Add Vehicle::GetEngine() to simplify code. 2011-11-01 00:21:08 +00:00
rubidium ff143c6708 (svn r22413) -Document: even more stuff 2011-05-02 20:59:54 +00:00
rubidium e34c42de32 (svn r22205) -Codechange: replace magic number with constant 2011-03-05 21:52:45 +00:00
glx 16dd93d3fb (svn r22048) -Fix (r4495): company 0 does not always exist, so put temporary vehicles in a valid company 2011-02-10 15:58:22 +00:00
terkhen 734994c9ba (svn r21924) -Codechange: Unify some parts of the articulated vehicle code.
-Cleanup: Avoid conversions to Train and RoadVehicle that are no longer required.
2011-01-29 17:30:25 +00:00
terkhen cfbbcf1597 (svn r21858) -Codechange: Give more similar names to ArticulatedPart functions. 2011-01-19 18:41:53 +00:00
terkhen 48b7916458 (svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains. 2010-12-14 21:33:53 +00:00
terkhen d6959dcc6b (svn r21517) -Codechange: Add IsGroundVehicle function to the Engine class. 2010-12-14 21:27:30 +00:00
terkhen 6a38925ca3 (svn r21123) -Codechange: Remove max_speed from the Vehicle class. 2010-11-09 17:43:05 +00:00
rubidium 30f2afac9b (svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to some headers 2010-08-26 22:01:16 +00:00
rubidium e356cb9405 (svn r20281) -Codechange: unify case scope closure + break coding style 2010-08-01 18:53:30 +00:00
alberth 33a96b5ef3 (svn r19132) -Codechange: No need to end a line with ;;. 2010-02-14 16:31:35 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
frosch 1e1fa9ff2e (svn r18566) -Codechange: When both the union and intersection of refit masks of articulated vehicles are needed, they can be determined at once. 2009-12-20 14:28:55 +00:00
peter1138 bcb33b50ac (svn r17911) -Codechange: bool * is a pointer, not a bool 2009-10-31 08:15:46 +00:00
frosch abbaed60d3 (svn r17907) -Codechange: Deduplicate result interpretation of articulated vehicle callback. 2009-10-30 21:51:36 +00:00
frosch 9a9d0ee7c0 (svn r17728) -Cleanup: Remove some more unneeded/unused parameters. 2009-10-06 19:52:38 +00:00
frosch 7a8a97e68a (svn r17726) -Cleanup: Remove some unneeded/unused parameters. 2009-10-06 19:30:31 +00:00