Commit Graph

606 Commits (bab5a8a78713299a4ea6be0ac6b94830c031fd57)

Author SHA1 Message Date
Rubidium bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 3 months ago
Michael Lutz 8dda387f82 Codechange: Use std::tuple for slope functions with two return values 3 months ago
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.
4 months ago
Peter Nelson 17d02ed45f
Feature: NewGRF properties to set town production effect and multiplier. (#11947)
Town production effect is modelled on town acceptance (growth) effect, and so takes an original cargo slot for behaviour instead of a direct value.

NewGRF feature 0x0B, property 0x1E, takes 1 byte.

Valid values are:
- 0x00 to behave like passengers
- 0x02 to behave like mail
- 0xFF to behave like other cargo (i.e. not produced.)

If not set, town production effect is set based on the cargo label ('PASS' or 'MAIL').

Town production multiplier allows adjusting the amount of cargo produces when Town Production Effect is set, without needing to use callbacks.

NewGRF feature 0x0B (cargo), property 0x1F, accepts a 2 byte (word) value, similar to the cargo capacity multiplier property. The default value is 256 which means 100%, i.e. normal rate.
4 months ago
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 4 months ago
Peter Nelson 6d93fa649c Change: Towns generate cargo based on town production effect.
This replaces the fixed handling of passengers and mail.
4 months ago
Peter Nelson 60dcf3b5e2 Codechange: Rename TownEffect to TownAcceptanceEffect.
This makes it clearer that TownEffect only affects acceptance behaviour.
4 months ago
merni-ns ccaa383e85
Fix #11938: Check infinite money setting in cases where it was missed (#11939) 4 months ago
Tyler Trahan 41f2eed425
Feature: Settings to scale cargo production of towns and industries (#10606) 4 months ago
merni-ns 5a88027a19
Feature: Infinite money mode (#11902) 4 months ago
Peter Nelson bf013097a7
Fix #11918: Houses should build only next to road stops, not any station type. (#11919) 4 months ago
frosch 68c64d2511 Codechange: Remove TKM string codes by duplicating strings. 4 months ago
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 5 months ago
SamuXarick fddcaef74a Codechange: Use town zone constants instead of magic numbers 6 months ago
Jonathan G Rennison 8437b20fed Fix: Deleting towns did not check for waypoints referencing the town 6 months ago
Tyler Trahan 4181d3c1ff Codechange: Don't use a magic number for the number of DiagDirections 6 months ago
Tyler Trahan 2dad9263d7 Doc: Add, fix, and clean up documentation inside town_cmd.cpp 6 months ago
Tyler Trahan 745945c4d3 Codechange: Be consistent with how we name common parameters
TileIndex is always tile and Town is always *t. Don't use t and *town.
6 months ago
Tyler Trahan 1b14eca9d9 Codechange: Rename TryClearTile() for clarity
The function does not execute the clearing action.
6 months ago
Tyler Trahan a98fe9f317 Codechange: Rename MakeTownHouseBigger() for clarity 6 months ago
Tyler Trahan 060672428d Codechange: Merge confusingly-named helper functions into their timer 6 months ago
Tyler Trahan 1f41e773d6 Codechange: Use consistent name for bay road stops
As of #10494, this is how we describe original dead-end road stops.
6 months ago
Peter Nelson 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.
7 months ago
Tyler Trahan 088db62dba
Change: Always allow expanding towns in Scenario Editor to build new roads (#11377) 8 months ago
Peter Nelson 9602de474d Codechange: Use iterators and/or range-for on cargo related loops. 8 months ago
frosch 5733145c59 Cleanup: Remove unneeded parameters. 9 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
PeterN 6643c010bd
Fix: NewGRF house class mappings were not reset between games. (#11279) 9 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 9 months ago
Tyler Trahan fca2b37726 Codechange: Move Ticks into their own class 9 months ago
Patric Stout 07730584d7
Codechange: make explicit when a TileIndex is cast to its basetype (#11190)
This prevents people accidentially assigning a TileIndex to a Date
or any other type they shouldn't.
10 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 10 months ago
Jonathan G Rennison 6a048bc168 Fix #11164: Duplicate town names when using the many random towns function 10 months ago
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
11 months ago
Björn Wärmedal 7de37e07b6
Change: make Exclusive Transport Rights more exclusive (#11076)
Now, exclusive transport rights can only be bought if no company
currently owns them. A successful bribe will void any exclusive
transport rights that any *other* company currently has in the town.
11 months ago
Rubidium f86500df92 Codechange: remove need for SetDParamX 1 year ago
rubidium42 921f5afc4d Codechange: Apply suggestions from code review 1 year ago
Rubidium 2dd2b698d2 Codechange: convert C-style GetTownName API to std::string returning API 1 year ago
Peter Nelson 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
1 year ago
Peter Nelson c38df2d589 Codechange: Use std::map instead of custom SmallMap. 1 year ago
Tyler Trahan 98d809c33b
Codechange: Don't use macros for DAYS_TILL and friends (#10746) 1 year ago
Rubidium 19ec4e8beb Codechange: replace ClampToI32/U16 with ClampTo<int32_t/uint16_t> 1 year ago
Patric Stout 31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 1 year ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
Peter Nelson 087654501b Codechange: Initialise specs with std::fill/std::copy instead of memset/memcpy. 1 year ago
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
1 year ago
Patric Stout 3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 1 year ago
PeterN ff55bfb787
Fix #10343: Don't extend town-disallowed roadtypes. (#10347)
Towns currently don't build disallowed roadtypes, however they should
also not extend disallowed roadtypes as well.

If the roadtype that cannot be extended happens to be the roadtype that
the town was going to build then this restriction is ignored.
1 year ago
Rubidium e8af8daa68 Codechange: pass "ground vehicle" to GetTileSlopeZ since for tunnel/bridges there are two states
Previously it checked the position in non-driving direction to "guess" whether
a ground vehicle was using the function, so on tunnels/bridges it could either
return the Z of the (virtual) ground compared to the Z of the path the vehicle
would take.
1 year ago
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 1 year ago