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
Nicolas Chappe
977604ef08
Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo
...
Passengers usually prefer fast paths to short paths.
Average travel times of links are updated in real-time for use in Dijkstra's algorithm,
and newer travel times weigh more, just like capacities.
3 years ago
dP
c1d79398d5
Fix: Use of unstable sort when distributing cargo production can cause desyncs
3 years ago
glx22
89ab8b79a5
Codechange: Remove FOR_EACH_SET_BIT
3 years ago
rubidium42
55a11710a6
Codechange: convert printf DEBUG statements to fmt Debug statements
3 years ago
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
3 years ago
rubidium42
2e136285e1
Codechange: move from C-string to std::string for DoCommand
3 years ago
rubidium42
661728558e
Codechange: let IsUnique.* functions accept std::string
3 years ago
rubidium42
b791ffc6de
Fix: do not hide parameter by local variable with the same name
3 years ago
rubidium42
44ca7d9377
Change: Use gender-neutral pronouns
3 years ago
glx22
38c97e1492
Codechange: Replace TILE_AREA_LOOP with range-based for loops
3 years ago
glx22
2feb801e56
Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops
3 years ago
Jonathan G Rennison
ece9a356dc
Fix #9113 : Assertion failure when removing airport with order backup ( #9182 )
3 years ago
Peter Nelson
a3e49178d1
Codechange: Use std::vector for NewGRF station tile sprite layouts.
3 years ago
Peter Nelson
bd1a20f6ee
Codechange: Use std::vector for NewGRF station platform layouts.
...
This avoids the need to custom memory management and additional members.
This also resolves use-after-free if modifying copied layouts, so presumably nobody has ever done that.
3 years ago
glx22
9a8756d7ed
Codechange: Replace FOR_ALL_CARGOSPECS with range-based for loops
3 years ago
Jonathan G Rennison
25909b06d2
Fix #8809 : Crash when removing airport when hangar window open
4 years ago
SamuXarick
a4035af337
Codechange: Apply coding style ( #8640 )
...
* Fix: Missing or needed spaces
* Codechange: Remove space
* Codechange: Remove space
* Codechange: More missing spaces
* Codechange: Missing spaces
* Codechange: Remove space
* Codechange: Remove space
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
SamuXarick
79d938b957
Fix 0125892: Warning about unsigned unary minus
4 years ago
SamuXarick
f84a466ca5
Fix #7945 : Add cost of clearing the sloped tile when placing a dock ( #7947 )
4 years ago
gooball
0125892f04
Fix #8297 : Infrastructure counters for road tunnels, bridges, depots … ( #8454 )
...
The previous fix 887e9481ff0e70df6bf93ce15a3899a03f124c50 only worked for roads and failed to consider a multiplier used for the infrastructure totals for tunnels/bridges.
Also, depots and bus/truck stops are counted as 2 road pieces on creation but were only counted as 1 road piece on conversion because the function DiagDirToRoadBits() was used, which only ever returns single-piece road segments.
Co-authored-by: A. S <admin-git@sotai.tk>
4 years ago
glx22
d8605ad18d
Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loops
4 years ago
Pavel Stupnikov
9a45a0f535
Feature: Set exclusive access to industry from GS ( #8115 )
4 years ago
Michael Lutz
63ccb36ef3
Codechange: Use std::string for most of the user-settable custom names.
4 years ago
dP
f2a9a1e2a5
Fix #8137 : New clients can't join (desync) after funding an industry
4 years ago
dP
7bd52970a1
Codechange: Refactor FindStationsAroundTiles to avoid code duplication
4 years ago
glx
9339e4dcad
Fix #8081 : Check for waypoints when removing docking tiles
5 years ago
SamuXarick
ea7044a74b
Fix f5381798: Station::GetTileArea reduced docks to a single tile ( #8014 )
5 years ago
Niels Martin Hansen
3fcb240f8e
Fix d84b67e5: Station rating effects affecting too large area
5 years ago
Jonathan G Rennison
c3223903ed
Codechange: Cache resolved town, station and industry name strings
5 years ago
dP
1225693b9c
Feature: Improved logic of sharing industry production between 3 or more stations
5 years ago
SamuXarick
40605efd1c
Codechange: Use KDTree for AirportGetNearestTown ( #7424 )
5 years ago
glx
ee7a8eebca
Codechange: Replace FOR_ALL_TOWNS with range-based for loops
5 years ago
glx
d8a1be48cd
Codechange: Replace vehicle related FOR_ALL with range-based for loops
5 years ago
glx
9892d90b26
Codechange: Replace order related FOR_ALL with range-based for loops
5 years ago
glx
ddabfed1cd
Codechange: Replace station related FOR_ALL with range-based for loops
5 years ago
Jonathan G Rennison
35dc377a58
Fix: Infrastructure total update when removing tram road stop
...
The wrong road owner was used when updating the tram infrastructure total.
This could result in desyncs, negative infrastructure totals, etc.
5 years ago
Niels Martin Hansen
9900af38f5
Fix #7847 : Use ViewportSign coordinates for sign Kdtree coordinates ( #7849 )
...
Ensure the same coordinates are used for station/town/player signs regardless of how the landscape changes below it after the coordinates were first determined.
By keeping track of whether each ViewportSign is valid for Kdtree use (and only ever registering the viewport sign when the object is valid) a lot of code can be simplified and become more robust at the same time.
5 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
Jonathan G Rennison
2be619ea88
Fix #7820 : Heap use after free when removing oil rig
5 years ago
Charles Pigott
2f4de0a0fe
Fix #7733 : Crash when removing a dock next to an industry without a station
5 years ago
JMcKiern
04f659e768
Fix: Some typos found using codespell
5 years ago
Daniel Lee
2d9eb1c417
Fix #7626 : Allow building drive-through stops over one-way/blocked roads owned by towns (instead of crashing).
5 years ago
Juriy Petrochenkov
f0aea2d246
Fix: RemoveAirport function now returns with 'Aircraft in the way' error message as it should be.
5 years ago
peter1138
ec2656ab7e
Codechange: Restrict docking points of docks.
5 years ago
peter1138
f538179878
Feature: Multi-tile docks and docking points.
5 years ago
peter1138
402e18b460
Change: Allow building road stops over self-owned one-way/blocked road.
5 years ago
Niels Martin Hansen
d1ef13fc04
Fix #7481 : Just remove oil rig stations right away, don't clean them first
5 years ago
peter1138
c02ef3e456
Feature: Add NotRoadTypes (NRT)
5 years ago
PeterN
abe8cf4985
Codechange: Replace duplicated code with TileArea::Expand() ( #7467 )
6 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
6 years ago
kiwitreekor
bc9b47d2e5
Fix #6222 : Advanced sprite layout sometimes showed incorrect railtype ground tile
6 years ago
PeterN
e1069eee05
Codechange: Check airport layout would fit within map bounds before iterating tiles. ( #7429 )
6 years ago
PeterN
b6e3e30d86
Codechange: Distance between town and airport has already just been found, so use it. ( #7427 )
...
Previously the distance was thrown away, only to be expensively recalculated again.
6 years ago
PeterN
7fb77ff35a
Fix: Incorrect display of industry production around tiles. ( #7426 )
...
Display of industry production around tiles (as shown when placing a station)
did not take account of the station catchment changes, so still showed production
from an industry even if it was not covered by a tile.
This is fixed by making a set of nearby industries that are covered, instead of
looping over all possible industries.
6 years ago
Henry Wilson
c01a2e2a81
Codechange: Removed SmallVector completely
6 years ago
Henry Wilson
ab711e6942
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
6 years ago
Henry Wilson
297fd3dda3
Codechange: Replaced SmallVector::Include() with include()
6 years ago
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
6 years ago
Henry Wilson
ca2f33c6d0
Codechange: Replaced SmallVector::Erase() with std::vector::erase()
6 years ago
Henry Wilson
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
6 years ago
Niels Martin Hansen
ce10d9be3f
Fix #7374 : Ensure k-d trees are always updated when station sign moves
6 years ago
peter1138
b00a861467
Codechange: Make FindStationsAroundTile() out-parameter stations const to prevent incorrect modification.
6 years ago
peter1138
6b92b83128
Fix #7372 : FindStationsAroundTiles() with caching returns no result for industry tiles.
...
Currently this can only be triggered by NewGRF house tiles querying for cargo acceptance history
of nearby stations (var 0x64) with a tile offset, and providing an offset that happens to point
to an industry tile. This serves no useful purpose.
6 years ago
Johannes E. Krause
ba3d7122df
Cleanup: Remove questionable syntax in station rating calculation
6 years ago
Niels Martin Hansen
e8d397e4ee
Codechange: Make a merged k-d tree index of all viewport signs
6 years ago
Niels Martin Hansen
d84b67e54d
Codechange: Make a k-d tree index of stations
6 years ago
Peter Nelson
943c58e468
Fix: Show industry name in Land Area Information window for oil-rig type stations instead of just 'Oil Rig'
6 years ago
Peter Nelson
8b1b3fd0f9
Feature: Non-rectangular sparse station catchment area.
6 years ago
peter1138
ed6084523d
Codechange: Convert StationList from SmallVector to std::set.
6 years ago