Commit Graph

843 Commits (fac317b13972d5d86d3d2e5f65c64569d5dc6e32)

Author SHA1 Message Date
Rubidium 3e8f8c55c2 Codechange: make creating temporary StringParameters easier 1 year ago
Rubidium 1d902a97ce Codechange: move StringParameters to strings_internal.h 1 year ago
Rubidium 0a5e58451b Codechange: pass string parameters by reference 1 year ago
Rubidium 36aaa9d683 Codechange: let GetStringWithArgs use StringBuilder 1 year ago
PeterN 584faaf064
Change: Reorganise industry accept/produce arrays. (#10853)
Use a array of struct for each cargo instead of an array for each statistic.
This makes iterating for acceptance and production much simpler.
pct_transported is now calculated when needed.
1 year ago
Peter Nelson f177ce7c9a Codechange: Base CargoArray off std::array.
This avoids needing to define array accessors and allows use of
default value initialization.
1 year ago
Peter Nelson 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
1 year ago
Rubidium 3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 1 year ago
Peter Nelson e6740046ee Codechange: Use range-for iteration. 1 year ago
PeterN 882f06bf14
Fix: Support more than 256 stations/waypoints/roadstops per class. (#10793)
It was already possible to define more than 256 per class, but not possible
to use them as the index used in GUI and passed through commands was limited
to a byte.
1 year ago
Rubidium fb856e16c1 Codechange: replace some min/clamp constructs to ClampTo 1 year ago
Tyler Trahan 6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 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
Tyler Trahan bc44158f9a
Change: Allow overbuilding station and waypoint tiles (#10618) 1 year ago
Charles Pigott b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 1 year ago
Patric Stout 3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 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
Jonathan G Rennison c74dfe393f
Fix #10556: Duplication of road infrastructure count updates (#10557)
When building a road stop
2 years ago
Rubidium 580d0a6343 Codechange: make use of Tile in for all direct map accesses 2 years ago
Chenshu Yu eabb9db0bb
Fix #9810: 'Rebuilding' a through road stop costs money (#9852) 2 years ago
Michael Lutz aab580e0ac Codechange: [Linkgraph] Drop node/edge wrappers from LinkGraph. 2 years ago
Michael Lutz 7352f812e6 Codechange: [Linkgraph] Only store present link graph edges and not all possible edges. 2 years ago
Jonathan G Rennison 4c1406a4b5 Add: NewGRF road stops 2 years ago
Rubidium 8cbf1be9d6 Codechange: split large function into smaller functions with self-explanatory names 2 years ago
Jonathan G Rennison 9c915f05ec Fix: Water infrastructure accounting when building docks 2 years ago
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 2 years ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 2 years ago
Patric Stout 1fb101eabb
Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
2 years ago
Peter Nelson 138198e971 Change: Separate ground sprite from foundation sprite offsets. 2 years ago
SamuXarick a8a7f95665
Change: Allow to build dock on clearable watered object tiles (#8514) 2 years ago
Jonathan G Rennison 4dc741a8a0
Fix #10011: Incorrect infrastructure totals when overbuilding bay road stop (#10143)
Fix https://github.com/OpenTTD/OpenTTD/issues/10011
2 years ago
PeterN f59f0195e3
Fix: Wrong string used to determine size of zoomed out station sign. (#10036) 2 years ago
Patric Stout 100aca1848
Fix: CmdRemoveRoadStop didn't validate the height property properly (#9945)
Height was a unsigned 32bit integer, where TileAddWrap uses a
signed 32bit integer for the height. In result, there was an
implicit cast from unsigned to signed, messing things up.

But looking at it from a functional perspective, allowing such
large values is not sensible. In fact, width is restricted to
just a 8bit integer. By changing height to a 8bit integer too,
the implicit cast will never make a positive value negative anymore.
2 years ago
Jonathan G Rennison 19af139631 Fix #9937: Station industries_near incorrect after removing part moved sign
RecomputeCatchment was being called before moving the sign tile
instead of afterwards
2 years ago
Tyler Trahan f92cf38ab5 Feature: Allow disabling local authority control of company actions 3 years ago
Tyler Trahan fbbc80f79e Fix #9020: Update station coverage highlight when adding/removing tiles 3 years ago
J0anJosep d9a37c915f Cleanup #9725: Replace cmd_helper related functions and remove cmd_helper.h. 3 years ago
Jonathan G Rennison 4844268d1c Fix #9774: CmdBuildRoadStop updated station acceptance in estimate mode 3 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 3 years ago
Michael Lutz 55170ae703 Codechange: Un-bitstuff rail commands. 3 years ago
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 3 years ago
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.
3 years ago
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 3 years ago
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.
3 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 3 years ago
Loïc Guilloux 38a64eb2aa
Change: Allow all tiles around docks to be docking tiles (#9578) 3 years ago
SamuXarick 18247bb3b8
Fix #9521: Don't load at just removed docks that were part of a multi-dock station (#9524) 3 years ago
Nicolas Chappe b83820e723 Change: [Linkgraph] Delete links only served by vehicles stopped in depot
A stale link is not deleted if the link refresher finds a vehicle that still serves it.
This commit excludes vehicles stopped in depot for a very long time from the link refresher,
so that their stale links can be deleted.
3 years ago
Joan Josep cc38a42b07
Fix 659989af45: Set appropriate town window dirty when building/removing airports. (#9497) 3 years ago