Commit Graph

598 Commits

Author SHA1 Message Date
Tyler Trahan 41f2eed425
Feature: Settings to scale cargo production of towns and industries (#10606) 2024-01-30 15:11:46 -05:00
merni-ns 5a88027a19
Feature: Infinite money mode (#11902) 2024-01-30 18:01:02 +00:00
Peter Nelson bf013097a7
Fix #11918: Houses should build only next to road stops, not any station type. (#11919) 2024-01-29 01:27:34 +00:00
frosch 68c64d2511 Codechange: Remove TKM string codes by duplicating strings. 2024-01-28 14:44:24 +01:00
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
SamuXarick fddcaef74a Codechange: Use town zone constants instead of magic numbers 2023-12-18 22:12:43 +01:00
Jonathan G Rennison 8437b20fed Fix: Deleting towns did not check for waypoints referencing the town 2023-11-29 00:27:16 +01:00
Tyler Trahan 4181d3c1ff Codechange: Don't use a magic number for the number of DiagDirections 2023-11-28 14:24:33 -05:00
Tyler Trahan 2dad9263d7 Doc: Add, fix, and clean up documentation inside town_cmd.cpp 2023-11-28 14:24:33 -05:00
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.
2023-11-28 14:24:33 -05:00
Tyler Trahan 1b14eca9d9 Codechange: Rename TryClearTile() for clarity
The function does not execute the clearing action.
2023-11-28 14:24:33 -05:00
Tyler Trahan a98fe9f317 Codechange: Rename MakeTownHouseBigger() for clarity 2023-11-28 14:24:33 -05:00
Tyler Trahan 060672428d Codechange: Merge confusingly-named helper functions into their timer 2023-11-28 14:24:33 -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
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.
2023-11-06 20:29:35 +00:00
Tyler Trahan 088db62dba
Change: Always allow expanding towns in Scenario Editor to build new roads (#11377) 2023-10-19 17:01:45 -04:00
Peter Nelson 9602de474d Codechange: Use iterators and/or range-for on cargo related loops. 2023-10-19 17:03:25 +01:00
frosch 5733145c59 Cleanup: Remove unneeded parameters. 2023-09-19 22:49:59 +02:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
PeterN 6643c010bd
Fix: NewGRF house class mappings were not reset between games. (#11279) 2023-09-10 18:55:37 +01: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 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.
2023-08-15 18:12:05 +02:00
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 2023-08-12 18:14:21 +00:00
Jonathan G Rennison 6a048bc168 Fix #11164: Duplicate town names when using the many random towns function 2023-08-02 20:07:59 +02: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
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.
2023-07-14 14:00:28 +02:00
Rubidium f86500df92 Codechange: remove need for SetDParamX 2023-06-12 09:12:11 +02:00
rubidium42 921f5afc4d Codechange: Apply suggestions from code review 2023-06-05 17:07:39 +02:00
Rubidium 2dd2b698d2 Codechange: convert C-style GetTownName API to std::string returning API 2023-06-05 17:07:39 +02: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 c38df2d589 Codechange: Use std::map instead of custom SmallMap. 2023-05-18 12:18:30 +01:00
Tyler Trahan 98d809c33b
Codechange: Don't use macros for DAYS_TILL and friends (#10746) 2023-05-07 05:25:24 -04:00
Rubidium 19ec4e8beb Codechange: replace ClampToI32/U16 with ClampTo<int32_t/uint16_t> 2023-05-06 21:26:13 +02:00
Patric Stout 31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 2023-04-24 16:55:40 +00:00
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
Peter Nelson 087654501b Codechange: Initialise specs with std::fill/std::copy instead of memset/memcpy. 2023-04-23 15:58:27 +01:00
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
Patric Stout 3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 2023-04-15 13:58:55 +02:00
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.
2023-04-12 22:30:03 +01:00
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.
2023-04-09 19:00:26 +02:00
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
Rubidium 3373128233 Codechange: pass the randomizer directly to the town name generation 2023-01-14 22:00:11 +01:00
PeterN c8cc61d889
Fix #10150: Force FS_SMALL for small viewport signs. (#10283)
* Fix #10150: Force FS_SMALL for small viewport signs.

This is a workaround for string widths being different with mixed
font-sizes.

* Fix: Flag small sign shadow as small text.

(This method of drawing shadows is hilarious and needs replacing, but
this is a quick fix.)
2022-12-25 13:29:38 +00:00
Joel-Milligan 59645c6733
Change: Remove scrollbar from town authority actions panel (#9928) 2022-11-11 23:52:38 +01:00
Tyler Trahan 47a998fb0c Feature: Towns don't build parallel, redundant bridges 2022-10-18 22:02:45 +02:00
Tyler Trahan fa562ba041
Fix #9712: Cap town bridge length at original 11-tile limit (#9890) 2022-05-14 16:55:39 +02:00
Tyler Trahan f92cf38ab5 Feature: Allow disabling local authority control of company actions 2022-04-02 22:50:28 +02:00
J0anJosep d9a37c915f Cleanup #9725: Replace cmd_helper related functions and remove cmd_helper.h. 2022-02-02 21:30:15 +01:00