Commit Graph

139 Commits

Author SHA1 Message Date
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Michael Lutz 8dda387f82 Codechange: Use std::tuple for slope functions with two return values 2024-03-08 18:08:55 +01:00
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
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
Kuhnovic b38d3c2208
Change: simplified water region evaluation, removed savegame data (#11750) 2024-01-21 20:56:50 +00: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
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02: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
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
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00: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
Jonathan G Rennison e17420777a Fix #10637: Incorrect water infra total when building multi-tile object
Wrong tile used in ownership checks
2023-04-12 16:50:45 +02: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
Peter Nelson 82c70ed3b8 Change: Expose ObjectSpec vector to simplify iteration. 2023-04-02 22:42:38 +01:00
Peter Nelson 1f46f080f0 Codechange: Store objectspecs in std::vector instead of flat array. 2023-04-02 22:42:38 +01:00
Rubidium 580d0a6343 Codechange: make use of Tile in for all direct map accesses 2023-02-28 07:11:48 +01:00
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
PeterN 2355882ec1
Codechange: Remove object `enabled` flag and shuffle members. (#10358)
`enabled` flag is replaced with IsEnabled() which checks if views is
non-zero.

ObjectSpec is shuffled to reduce its memory footprint.
2023-01-15 10:58:03 +00:00
Rubidium f667a831a5 Codechange: unify creation of diagonal/orthogonal iterator using smart pointers 2023-01-13 21:09:40 +01:00
Tyler Trahan c65a2799c9 Fix #10117: Decrement object burst limit after build check 2022-11-01 13:58:52 -06:00
Tyler Trahan 3d45bc4abe Feature: Build objects by area 2022-10-16 18:28:08 +02:00
Loïc Guilloux 93b711d70d
Fix #10048: Don't relocate company HQ on the same exact location (#10049) 2022-09-24 21:56:23 +02:00
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 2021-12-16 22:28:32 +01:00
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 2021-12-16 22:28:32 +01:00
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
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
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
Tyler Trahan e9cb9c1135
Fix #9579: Object and HQ construction is Construction cost, not Property Maintenance (#9673) 2021-11-08 08:12:15 +00:00
SamuXarick e404d16929
Fix #9591: Update station docking tiles upon placing a water object on a docking tile (#9594) 2021-10-03 12:54:19 +02:00
dP 39662aabef
Add: allow gamescripts to build neutral objects (#9568) 2021-09-25 13:39:40 +02:00
Charles Pigott d4588df9f9 Fix #9527: Crash when trying to place multitile objects at map edge 2021-09-11 23:10:50 +01:00
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
glx22 38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 2021-05-13 00:13:54 +02:00
Charles Pigott d9df20d102 Change: Use a more specific error message when attempting to bulldoze your own HQ 2021-02-13 18:10:13 +00:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Patric Stout 28c13ec90f
Fix #8168: allow relocating of HQ partial over existing HQ (#8510)
Just in case you want to move it SLIGHTLY to the right.
2021-01-06 22:37:57 +01:00
glx 514565fad6 Codechange: Replace FOR_ALL_OBJECTS 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
Samu 3d362f2513 Fix #7697: Add a Missing AddProducedCargo proc for HQ
On TileLoop_Object, HQs are able to produce and move passengers and mail to stations, but querying the HQ tiles for cargo supplied was returning nothing. This makes it so that they return +1 to both passengers and mail.
2019-11-10 17:58:02 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
PeterN 812886ca61
Fix #7478: Don't remove NewGRF objects on company take-over. (#7483) 2019-04-08 19:20:43 +01:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00: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
Johannes E. Krause 234f1007f7 Cleanup: Remove questionable syntax in HQ size calculation 2019-03-13 07:47:32 +00:00
PeterN 4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 2018-05-21 22:08:39 +01:00
frosch d7ee0b6fee (svn r27656) -Fix [FS#6511]: When removing objects of bankrupt companies the tiles may revert to canal. In that case also check the ownership of the canal. 2016-09-18 14:07:52 +00:00