Commit Graph

257 Commits

Author SHA1 Message Date
Peter Nelson
65e0b0dcb7 Codechange: Be consistent with how company masks are set to all. 2023-04-07 22:09:55 +01:00
Michael Lutz
05ed9f56fd Feature: [NewGRF] Engine name callback. 2023-01-30 22:00:56 +01:00
glx22
012fd2be0d Codechange: Suppress warnings when asserts are disabled 2022-12-30 02:17:38 +01:00
Peter Nelson
cbf48c4dd9 Change: Add extra random seed to StartupEngines().
This means that calling reset_engines will rerandomise introduction dates
and reliability.

Probably not necessary.
2022-12-25 16:41:58 +00:00
Peter Nelson
74180efe7f Change: Attempt to improve randomisation of reliability 2022-12-25 16:41:58 +00:00
Peter Nelson
3485709f53 Add: Additional vehicle flags to control variants. 2022-12-25 16:41:58 +00:00
Peter Nelson
898dadadb2 Change: Mark build/autoreplace windows dirty less often in monthy loop.
These window classes were marked dirty for every engine that had
reliability calculated every month.
2022-12-25 16:41:58 +00:00
Peter Nelson
c11db7d593 Change: Clear last variant when engine becomes unavailable. 2022-12-25 16:41:58 +00:00
peter1138
d7f561a400 Change: Add variant property to engines. 2022-12-25 16:41:58 +00:00
frosch
acf9d786f1
Fix: [NewGRF] Default value of RailVehicleInfo::railveh_type was inconsistent with other default properties. (#9967)
If a NewGRF assigned neither "power" nor "dual-headed" properties,
then "railveh_type" defaulted to "singlehead-engine", while "power=0" said "it's a wagon".
2022-08-26 20:50:33 +02:00
Michael Lutz
21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 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
Patric Stout
28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
2021-06-03 17:30:00 +02:00
glx22
5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
rubidium42
2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
rubidium42
661728558e Codechange: let IsUnique.* functions accept std::string 2021-05-29 19:02:18 +02:00
PeterN
3dbd6475fe
Codechange: Use C++ features for train wagon overrides. (#9141)
This removes the need for C-style array management and allows use of iterators to perform wagon override lookups.
2021-04-30 12:03:07 +01:00
dP
7c7c6cde03 Fix: Do not unlock railtypes when enabling wagons with GameScript 2021-04-17 22:26:11 +02:00
Patric Stout
fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02:00
dP
d8dfa1613f Fix: Recompute road/railtype availability after disabling the engine 2021-03-20 17:55:23 +00:00
Patric Stout
5f591c86fe
Fix 85a49a0d: invalidate airport toolbar when new planes become available (#8532)
Otherwise if the airport button is disabled, it will remain disabled
until you close/open the toolbar again.
2021-01-08 22:34:21 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
frosch
b08d8c7edb Cleanup 9f42358: Make also reliability_start randomised independent of introduction date. 2021-01-03 14:56:43 +00:00
frosch
d24a9a9df5 Cleanup 8139b14: Move a comment back to the line it belongs to, and add a comment for new code. 2021-01-03 14:56:43 +00:00
SamuXarick
9f423586ad
Change #8325: Make engine reliability independent of introduction date (#8470) 2020-12-31 17:06:48 +01:00
Charles Pigott
860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Michael Lutz
79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 2020-12-15 00:29:30 +01:00
Michael Lutz
63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 2020-05-21 20:02:34 +02:00
Pavel Stupnikov
d7a928a08b Feature: GS method to control engine availability for a specific company (#7791)
* Feature: GS method to allow company to use an engine before its introduction date

* Feature: GS method to retire an engine early for a specific company
2020-01-15 18:46:26 +01:00
glx
d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
glx
1f6b3a37f9 Codechange: Replace FOR_ALL_ENGINES with range-based for loops 2019-12-21 20:13:03 +01:00
glx
3a14cea068 Codechange: Replace FOR_ALL_COMPANIES 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
peter1138
c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Henry Wilson
7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson
ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson
a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 2019-03-26 20:15:57 +00:00
Henry Wilson
bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 2019-03-26 20:15:57 +00:00
Eddi-z
8139b14e9c Change: Synchronize introduction date and reliability randomness across vehicles with the same base introduction date (#7147) 2019-03-02 21:28:22 +00:00
Charles Pigott
f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
Johannes E. Krause
662dcc3c31 Fix #6920: Make 9.8m/s^2 a common constant for TE-calculation 2018-09-30 20:45:41 +02:00
PeterN
4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 2018-05-21 22:08:39 +01:00
alberth
ad88588481 (svn r27797) -Add: Display aircraft type in its vehicle window (patch by Samu) 2017-03-18 20:43:43 +00:00
frosch
4b8b9e1cb1 (svn r27700) -Codechange: Simplify railtype date introduction. A check that is safe to run every day before the last railtype has been introduced, is also safe to run after the last railtype has been introduced. 2016-12-20 12:35:36 +00:00
frosch
ee9a54c0a0 (svn r27598) -Fix: Company 0 could accept engine previews before they were offered. 2016-06-09 19:04:53 +00:00
frosch
ebb6e38075 (svn r27578) -Fix [FS#6454]: Vehicles could not be hidden from the purchase list when they were in exclusive preview. 2016-05-22 11:04:34 +00:00
alberth
f72ad87540 (svn r26802) -Add: Command to set visibility of an engine for a company (based on patch by Juanjo). 2014-09-07 16:12:58 +00:00
rubidium
9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00