Rubidium and rubidium42
7c0f69a8fe
Codefix: typos in comments and strings
2025-08-31 10:30:37 +02:00
Peter Nelson and GitHub
1af721a6f0
Add: [Badges] Vehicle variable to query badges of current rail or road types. ( #14312 )
2025-08-11 19:08:48 +01:00
Peter Nelson and GitHub
a2addf0fe7
Fix: Clear rail vehicle flipped flag if reverse probability callback returns false. ( #14281 )
...
This now distinguishes between not-flipped and callback not implemented.
2025-05-20 23:03:55 +01:00
Peter Nelson and GitHub
ce83f583bc
Codechange: Use EnumBitSet for VehicleRailFlags. ( #14280 )
2025-05-19 18:56:45 +01:00
frosch and frosch
22fedca77e
Codechange: Integrate ResolverObject::ResetState() into DoResolve(), no need to call it manually.
2025-05-06 22:24:41 +02:00
frosch and frosch
6faa667644
Codechange: Remove global GetRegister(), instead return 100+ registers directly from GetXxxCallback().
2025-05-06 22:24:41 +02:00
frosch and frosch
85be7a4d92
Codechange: Access temporary storage through ResolverObject during Resolve.
2025-05-06 22:24:41 +02:00
frosch and frosch
99d7a775ad
Codechange: Make GetRegister return a signed integer, matching the underlying TemporaryStorageArray.
2025-05-06 22:24:41 +02:00
frosch and GitHub
13349254ea
Fix #14216 , d030d17: RealSpriteGroups referencing CallbackResultSpriteGroups were always treated as callback-failure. ( #14218 )
2025-05-05 16:13:41 +02:00
frosch and frosch
d030d17bd6
Codechange: Do not use a mutable global to return calculated VarAction2 results.
2025-04-29 20:35:46 +02:00
frosch and frosch
e90b68d504
Codechange: Pass SpriteGroup as reference to ResolveReal.
2025-04-29 20:35:46 +02:00
frosch and frosch
8027e31f47
Codechange: Remove virtual functions SpriteGroup::GetResult and GetNumResults. They are only implemented in and called via ResultSpriteGroup.
2025-04-29 10:35:10 +02:00
frosch and frosch
010b944173
Codechange: Move SpriteGroup cast from callers into Resolve.
2025-04-29 10:35:10 +02:00
frosch and GitHub
30b1eb6e5f
Fix: [NewGRF] The result of Action123 evaluation affected rerandomisation in a weird corner case. ( #14139 )
...
Rerandomisation does not care about the Resolve result.
But we skipped it, in case of 'invalid SpriteGroup reference'.
2025-04-28 23:24:42 +02:00
frosch and frosch
b7e7f08f78
Codechange: Simplify usage of GRFFileProps by adding some common helper methods.
2025-04-28 13:44:46 +02:00
frosch and frosch
41a20e512d
Codechange: Use proper enum type to index sprite groups in VariableGRFFileProps.
2025-04-27 19:50:51 +02:00
frosch and GitHub
61a0a520f6
Codechange: Unify random trigger enums and turn them into enum classes. ( #14066 )
2025-04-21 20:03:34 +02:00
frosch and frosch
264abfafe6
Codechange: Rename storage of random triggers to include the term 'random'.
2025-04-21 19:06:13 +02:00
frosch and frosch
39220a5feb
Codechange: Unify naming of NewGRF random trigger functions.
2025-04-21 19:06:13 +02:00
frosch and GitHub
98445088b1
Codechange: Move VehicleEnteredDepotThisTick call to a more suitable position. ( #14065 )
2025-04-21 17:52:03 +02:00
frosch and frosch
8f335a84cf
Codechange: Turn GetCustom(Vehicle|Rotor)(Sprite|Icon) macros into functions.
2025-04-18 23:41:37 +02:00
frosch and GitHub
b862d4937f
Codechange: Turn custom vehicle spritenums into enum, and use them consistently. ( #14022 )
2025-04-18 15:19:28 +02:00
Rubidium and rubidium42
a908c7bed0
Codechange: remove uses of MemCmpT (and MemMoveT)
2025-03-18 21:18:37 +01:00
enveeed and GitHub
b0cc56a8b5
Fix: NewGRF vehicles display loading sprites when not actually loading or unloading ( #13554 )
2025-03-15 16:58:47 -04:00
Peter Nelson and GitHub
8b39b23d2b
Codechange: Use EnumBitSet for VehicleFlags. ( #13793 )
2025-03-13 08:38:54 +00:00
Peter Nelson and GitHub
91d22f7617
Codechange: Use EnumBitSet for VehStates. ( #13755 )
...
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Peter Nelson and GitHub
3fde611012
Codechange: Use EnumBitSet for AirportMovingDataFlags. ( #13754 )
2025-03-06 19:03:41 +00:00
Peter Nelson and GitHub
a8f56fe7b3
Add: Variable to test how many vehicles in a chain contain a specific badge. ( #13594 )
2025-02-25 20:55:11 +00:00
Peter Nelson and GitHub
9de913dd21
Codechange: Use helper to set grf_prop's grffile and grfid together. ( #13612 )
2025-02-18 22:33:13 +00:00
Peter Nelson and Peter Nelson
8f14894024
Add: NewGRF Badges.
2025-02-16 22:24:25 +00:00
Rubidium and rubidium42
fd4adc55e3
Codechange: replace INVALID_X with XID::Invalid() for PoolIDs
2025-02-16 20:23:00 +01:00
Rubidium and rubidium42
59df0ff496
Codechange: strongly type StationID
2025-02-16 18:25:51 +01:00
Rubidium and rubidium42
70c9f3963c
Codechange: strongly type VehicleID
2025-02-16 14:50:15 +01:00
Rubidium and rubidium42
7e04651220
Codechange: strongly type EngineID
2025-02-16 14:50:15 +01:00
Rubidium and rubidium42
9015c3651f
Codechange: make EngineID an enum
2025-02-16 14:50:15 +01:00
Peter Nelson and GitHub
ff7eb996e6
Codechange: Use variable storage for GrfProps with cargo-type groups. ( #13557 )
...
Slots are only allocated when used instead of being reserved.
Array-based GrfProps are still used when the number of options is more limited.
2025-02-14 18:30:17 +00:00
Jonathan G Rennison and rubidium42
d06b371254
Cleanup: Fix various spelling errors
2025-02-12 22:44:51 +01:00
Peter Nelson and GitHub
d61b376998
Codechange: Use EnumBitSet for CargoClasses. ( #13491 )
2025-02-08 08:46:38 +00:00
Rubidium and rubidium42
e937c4dcfd
Codechange: change DestinationID into class with conversion helpers
...
A DestinationID is either a DepotID or StationID, where the aircraft hangar
being conceptually a depot is actually a StationID. When making those types
stronger, a lot of casts would need to be added, but this shows the intent
much better.
2025-02-06 21:03:24 +01:00
Peter Nelson and Peter Nelson
f8b1e3033f
Codechange: Use EnumBitSet for EngineFlags.
2025-01-31 18:55:31 +00:00
Peter Nelson and Peter Nelson
6c4ddb242a
Codechange: Use EnumBitSet for EngineMiscFlags.
2025-01-31 18:55:31 +00:00
Peter Nelson and GitHub
917d5cc75d
Codechange: Use EnumBitSet for RoadTypeFlags and RailTypeFlags. ( #13415 )
2025-01-30 22:08:51 +00:00
Peter Nelson and GitHub
afc0745aa2
Codechange: Specify underlying type for all enums excluding those exposed to scripts. ( #13383 )
2025-01-28 22:17:34 +00:00
Rubidium and rubidium42
e894a5880c
Codechange: rename CargoID to CargoType and amend related variables/comments
2025-01-26 18:07:10 +01:00
Peter Nelson and GitHub
41c9f2d82c
Codefix: Pass cargo as CargoID. ( #13311 )
2025-01-13 19:23:26 +00:00
Peter Nelson and GitHub
cfb995b6e9
Codechange: Reimplement engine sort order with std::rotate. ( #13124 )
2024-12-05 22:17:40 +00:00
Peter Nelson and Peter Nelson
f56b6756f1
Codechange: Sort EngineOverrideManager for fast lookups.
...
Allows quickly finding the EngineID given the type, grfid and local id of an engine, instead a linear scan.
This can reduce loading time when lots of engines are present and also affects performance in-game.
Lookup can be on the order of 10000 times faster.
2024-12-05 18:17:58 +00:00
Peter Nelson and Peter Nelson
bc2513975f
Codechange: Don't inherit EngineOverrideManager from std::vector.
...
Inheriting from std::vector means some operations are needlessly complex, and shouldn't really be done anyway.
2024-12-05 18:17:58 +00:00
Peter Nelson and Peter Nelson
e73d6fcaac
Codechange: Store grfid with entity grfprops.
...
This allows using the grfid without having to dereference the grffile pointer.
Uses no extra storage as it fits within otherwise wasted padding space.
2024-12-05 18:17:58 +00:00
Peter Nelson and Peter Nelson
3be0166801
Codechange: Use std::ranges::find where possible.
...
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00