Commit Graph

873 Commits (b0f3417025064d2a0890ff0356d954e1e794de20)

Author SHA1 Message Date
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 4 years ago
SamuXarick ea7044a74b
Fix f5381798: Station::GetTileArea reduced docks to a single tile (#8014) 4 years ago
Niels Martin Hansen 3fcb240f8e Fix d84b67e5: Station rating effects affecting too large area 4 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) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
kiwitreekor bc9b47d2e5 Fix #6222: Advanced sprite layout sometimes showed incorrect railtype ground tile 5 years ago
PeterN e1069eee05
Codechange: Check airport layout would fit within map bounds before iterating tiles. (#7429) 5 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.
5 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.
5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson 297fd3dda3 Codechange: Replaced SmallVector::Include() with include() 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson ca2f33c6d0 Codechange: Replaced SmallVector::Erase() with std::vector::erase() 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
Niels Martin Hansen ce10d9be3f Fix #7374: Ensure k-d trees are always updated when station sign moves 5 years ago
peter1138 b00a861467 Codechange: Make FindStationsAroundTile() out-parameter stations const to prevent incorrect modification. 5 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.
5 years ago
Johannes E. Krause ba3d7122df Cleanup: Remove questionable syntax in station rating calculation 5 years ago
Niels Martin Hansen e8d397e4ee Codechange: Make a merged k-d tree index of all viewport signs 5 years ago
Niels Martin Hansen d84b67e54d Codechange: Make a k-d tree index of stations 5 years ago
Peter Nelson 943c58e468 Fix: Show industry name in Land Area Information window for oil-rig type stations instead of just 'Oil Rig' 5 years ago
Peter Nelson 8b1b3fd0f9 Feature: Non-rectangular sparse station catchment area. 5 years ago
peter1138 ed6084523d Codechange: Convert StationList from SmallVector to std::set. 5 years ago
PeterN dd20ccee88
Feature: Industries with neutral stations (e.g. Oil Rig) only supply/accept cargo to/from their neutral station. (#7234)
This change is a controlled by a game setting, located under Environment ->
Industries which allows toggling the behaviour. It defaults to enabled.

"Company stations can serve industries with attached neutral stations"

When enabled, industries with attached neutral station (such as Oil Rigs) may
also be served by company-owned stations built nearby. This is the traditional
behaviour.

When disabled, these industries may only be served by their neutral station.
Any nearby company-owned stations won't be able to serve them, nor will the
neutral station serve anything else other than the industry.
5 years ago
SamuXarick 456e67ac1c Change: Owner of vehicle with exclusive transport rights may now load cargo from neutral stations (#7256) 5 years ago
Juanjo 45ce517105 Codechange: Move some common code after adding/removing tiles to a station to its own function. 5 years ago
Peter Nelson 81330b8d6e Change: Add path cache for ships. 6 years ago
nikolas d8ccad91f9 Fix: Some code and comment typos
Found with codespell
6 years ago
Johannes E. Krause 06cd561cea Add: when placing non-rectangular airport, consider airport tile table tiles only (patch by adf88, #6613) 6 years ago
Joost Hopmans 5029cd6f28 Fix: Only possible to build station next to competitors by using CTRL+click
Fix by checking only for stations owned by the current company when
inspecting if there are multiple adjoining stations to the one being built.

When building next to 2 or more owned stations we don't know which
station should be extended. For other companies' stations that's not a
problem since our station won't merge with theirs anyway.

Calling to BuildStationPart should never have another company's station
as a parameter to attach to unless the client is malicious, so just returning
a generic error in that case.
6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
Peter Nelson bf8d7df736 Change: Extend rail types to 64 (6 bit storage) 6 years ago
Peter Nelson 408cee123d Fix: One-way roads could be over-built by road stops (regardless of road owner.) 6 years ago
PeterN 4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 6 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
peter1138 890a44f130 (svn r27810) -Change: Factor out reservation-handling code in station_cmd.cpp
Code dealing with freeing and restoring track reservations is
duplicated in CmdBuildRailStation and RemoveFromRailBaseStation;
make separate functions for it. (cirdan)
7 years ago
frosch 10293c5fb1 (svn r27686) -Change: List railtype of rail tiles explicitly in the tile info window. 8 years ago
fonsinchen 58fdd3ac98 (svn r27682) -Fix: Don't check if links are alive for manually routed cargo 8 years ago
fonsinchen 662c019136 (svn r27681) -Fix: When deleting stale links, iterate through order lists before iterating through vehicles 8 years ago
frosch d9bfe88261 (svn r27676) -Codechange: Rename catenary functions, so that they refer unambiguously to either RoadCatenary or RailCatenary. 8 years ago
frosch 62bc57db77 (svn r27311) -Fix: Mark infrastructure window dirty in more cases. (marcole) 9 years ago
frosch 904688c00a (svn r27308) -Fix [FS#6283]: Prevent breaking of tram-reversal points by adding more road pieces. (adf88) 9 years ago
frosch 046cb6140f (svn r27256) -Change [FS#6165]: Do not consider cargo that is already being loaded as waiting cargo wrt. the station rating. 9 years ago
frosch 0ea4127837 (svn r27251) -Feature [FS#6252]: Make Ctrl+Remove-Roadstop also remove the road, just like for rail stations. (adf88) 9 years ago
frosch 6bdae2f64a (svn r27246) -Codechange: Deduplicate code between removing part of a rail station and removing the whole rail station. (adf88) 9 years ago
frosch 272c386fa8 (svn r27245) -Fix [FS#6251]: Removing a rail waypoint used the remove-rail-station cost. (adf88) 9 years ago
planetmaker 84e5c5a9cb (svn r27225) -Change [FS#6262]: Be more lenient about road stop removal when at least one stop could be removed (afd88) 9 years ago
frosch 780e595933 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 9 years ago
fonsinchen 9fdb88962f (svn r26891) -Codechange: Add methods to retrieve flows from a FlowStatMap 10 years ago
rubidium 9daf7e749c (svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible 10 years ago
fonsinchen 957f5ca117 (svn r26646) -Fix [FS#6041]: Save locations instead of distances in link graphs to reduce size. 10 years ago
rubidium 0ceb05ee9f (svn r26582) -Feature-ish: quickly decay cargo after about 21 months of not having picked any of the cargo, and prevent houses and industries providing more cargo 10 years ago
rubidium 89c25b955e (svn r26580) -Codechange: s/GES_PICKUP/GES_RATING/ (it has nothing to do with actual pickup), s/acceptance_pickup/status/ (the enum isn't called GoodEntryStatus for a reason; it's not only acceptance and pickup anymore) 10 years ago
fonsinchen 11d98f043e (svn r26549) -Change: better estimation for link capacities during full load 10 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
planetmaker ba42bcdf49 (svn r26458) -Doc: Correct a few spelling mistakes (__ln__) 10 years ago
fonsinchen bef953a32c (svn r26448) -Fix [FS#5970]: Avoid division by 0 when scaling flow values. 10 years ago
fonsinchen 5d3fcce725 (svn r26393) -Fix: Update distances between link graph nodes when station sign is moved 10 years ago
frosch a9acaf7a5e (svn r26375) -Fix [FS#5929]: Station sizes > 8 were always allowed. (adf88) 11 years ago
rubidium 98539bd2c3 (svn r26363) -Codechange [FS#5894]: make it clearer that drive through road stops need an Axis in CmdBuildRoadStop and the non drive through stops need a DiagDir 11 years ago
frosch 932dad7c8b (svn r26275) -Fix: If NewGRF provided the same station name for different industry types, stations would end up with same name. So also consider the provided name, not only the industry type. 11 years ago
fonsinchen ec492bfb77 (svn r26166) -Fix: Scale flows only after mapping to avoid rounding errors. 11 years ago
fonsinchen e6668f24b5 (svn r26013) -Revert (r25495) [FS#5684]: Having trains miss a platform that is just being modified is less of a problem than having trains stop twice without moving. 11 years ago
fonsinchen 962d6d7e48 (svn r25963) -Fix [FS#5758]: Mixtures of old and new flows could create cycles. 11 years ago
fonsinchen f6fd21e8e6 (svn r25948) -Fix [FS#5796]: Make sure LinkRefresher doesn't delete the LinkGraph DeleteStaleLinks() is examining. 11 years ago
fonsinchen 8926398f89 (svn r25915) -Fix: Unrestricted flow was counted incorrectly when invalidating flow. 11 years ago
fonsinchen f528d2c592 (svn r25910) -Fix: Guard against empty FlowStats in a few more places. 11 years ago
fonsinchen 6e1cc80926 (svn r25903) -Codechange: Refactor RefreshNextHopsStats into an own class LinkRefresher. 11 years ago
fonsinchen 2f9c48b859 (svn r25901) -Fix [FS#5675]: Check if any vehicles are still serving a link before deleting it. 11 years ago
fonsinchen 6524849386 (svn r25899) -Change: Restrict flows if links are restricted and don't normally pick them anymore. 11 years ago
fonsinchen 29e987f3fc (svn r25898) -Codechange: Add second timestamp for 'restricted links' to all edges. 11 years ago
fonsinchen 9337c561b0 (svn r25892) -Fix: off-by-one error in GetVia prevented certain flows from getting picked 11 years ago
fonsinchen 54db96be43 (svn r25891) -Feature: Use smallstack to allow for multiple next hops when loading and unloading. 11 years ago
zuu dfb5663313 (svn r25849) -Codechange: Introduce IsTileFlat to not compute full slope information for situations when we only want to know if a tile is flat or not (cirdan, LordAro) 11 years ago
rubidium d3ccc7c194 (svn r25495) -Fix [FS#5553]: when addings bits to a (train) station, the train trying to stop there could overshoot the (new) stop location and not stop at all 11 years ago
rubidium b4106e686b (svn r25461) -Fix: MSVC compiler warning 11 years ago
fonsinchen 930c19dae2 (svn r25435) -Fix: reroute cargo in vehicles if station is deleted 11 years ago
fonsinchen 3dd811e179 (svn r25434) -Fix: reroute cargo staged for unloading if a link breaks 11 years ago
fonsinchen f0119308f6 (svn r25424) -Fix: keep old flows around in an invalidated state to continue routing cargo if necessary 11 years ago
fonsinchen 1c995a3faa (svn r25391) -Fix: make ChangeShare really aware of INT_MIN 11 years ago
fonsinchen 6166772bc5 (svn r25379) -Fix: avoid warning in FlowStatMap::FinalizeLocalConsumption 11 years ago
fonsinchen 0fc198cb00 (svn r25365) -Feature: show cargo by next hops and final destinations in the station GUI 11 years ago
fonsinchen 741c431caa (svn r25362) -Feature: consider cargo waiting at other stations for rating at the origin station 11 years ago
fonsinchen 04e3eb6fab (svn r25361) -Feature: distribute cargo according to plan given by linkgraph 11 years ago
fonsinchen 5c8ff0a251 (svn r25359) -Codechange: schedule jobs when tracking capacities of links 11 years ago
fonsinchen db671ffb86 (svn r25346) -Codechange: Glue between stations and flow stats 11 years ago
fonsinchen c8f068d979 (svn r25345) -Add: implementation of SharesMap and FlowStatMap 11 years ago
rubidium be4f85766c (svn r25260) -Codechange: occasionally clear dead links and compress link graphs (fonsinchen) 11 years ago
rubidium 3947453277 (svn r25259) -Codechange: track capacities and usage of links 11 years ago
rubidium 1a0c081c18 (svn r25251) -Fix [FS#5540]: when overbuilding a reserved track with a non-track station tile, that tile would remain reserved and eventually trigger a crash upon removal 11 years ago
rubidium 0d05b8a0fb (svn r25243) -Fix [FS#5546]: "No station" error was given, even when there was a station that way occupied or not yours 11 years ago
frosch 5eddbb338b (svn r25185) -Fix [FS#5508]: Remove ambivalent functions CargoList::Empty() and Count(), and replace them with VehicleCargoList::StoredCount(), TotalCount(), StationCargoList::AvailableCount() and TotalCount(). (fonsinchen) 11 years ago
rubidium b2292122b6 (svn r25149) -Codechange: replace 'magic' 'has rating' bitcheck by descriptive function 11 years ago
rubidium 9986691220 (svn r25132) -Fix [FS#5510, FS#5516]: station rebuilding could leave reserved tiles which caused crashes later on 11 years ago
rubidium bae033c23d (svn r25016) -Fix [FS#5476]: integer overflow in UpdateStationRating (fonsinchen) 12 years ago
rubidium 2795ed5b09 (svn r25008) -Codechange: Make CargoList::Truncate behave similarly to CargoList::MoveTo, i.e. pass the amount to truncate (fonsinchen) 12 years ago
rubidium c7168f09c3 (svn r24961) -Fix [FS#5362] (r23564): making occupied platforms larger would make train reserve onto the newly unreserved bit and cause crashes. Now if a platform is enlarged and there is a reservation, reserve the whole platform 12 years ago
frosch 6f80f4ac29 (svn r24951) -Fix: [NewGRF] Var 10 of CB 24 missed the T part. 12 years ago
peter1138 c00a400cc7 (svn r24905) -Feature(ish): Implement station randomisation triggers. 12 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
peter1138 fb58c42aa0 (svn r24840) -Fix: Draw NewGRF railtypes in NewGRF station previews. 12 years ago
frosch eb56e60e94 (svn r24721) -Fix (r24715): Reallow building road stations. 12 years ago
frosch b518f1342c (svn r24720) -Fix (r24715): Comparison of different height units. 12 years ago
frosch 883f9bec9b (svn r24718) -Codechange: Rename GoodsEntry::days_since_pickup to GoodsEntry::time_since_pickup. 12 years ago
frosch 96540079e7 (svn r24715) -Fix [FS#5335]: [NewGRF] Allow stations to draw snow/desert aware ground sprites with railtype overlays. 12 years ago
frosch f3be01c26f (svn r24714) -Fix [FS#5337]: [NewGRF] Draw default foundations if resolving of custom station foundation sprites fails. 12 years ago
frosch 0566b29ab7 (svn r24708) -Codechange: Check magic values of GoodsEntry::last_speed only via wrapper function. 12 years ago
frosch a2980378ff (svn r24704) -Cleanup: No need to initialise stuff twice. 12 years ago
frosch e6459a91dd (svn r24703) -Fix: Disallow closing oilrig airports in SE. 12 years ago
alberth 0849fb8d36 (svn r24535) -Doc: Two additions, lots of small spelling fixes, and some Doxygen improvements. 12 years ago
frosch c8cb096533 (svn r24402) -Fix [FS#5243]: Station properties 11 and 14 were combined incorrectly. 12 years ago
frosch 0fd41221c3 (svn r24355) -Codechange [FS#5217]: Deduplicate code when building stations. (Hirundo) 12 years ago
frosch ca10522e8d (svn r24354) -Fix: When airport construction was denied due to noise, the error message named the wrong town. 12 years ago
frosch a8c88f43b6 (svn r24284) -Codechange: Remove NewsSubtypes and directly use NewsTypes and NewsFlag instead. 12 years ago
frosch c841a78f69 (svn r24167) -Codechange: Rename NewGRFClass::GetCount() to NewGRFClass::GetClassCount() 12 years ago
frosch 0f0e7e43cf (svn r24166) -Codechange: Turn NewGRFClass::Get(Tid, uint) and GetCount(Tid) into non-static members GetSpec(uint) and GetSpecCount(). 12 years ago
frosch 6f4d2160c2 (svn r24162) -Codechange: Remove NewGRFClass::GetName() and SetName() in favour of using Get() and direct member access (which is needed anyway for GRF string resolving). 12 years ago
michi_cc aa47d6c7f2 (svn r24127) -Feature [FS#1497]: Allow closing airports for incoming aircraft. (Based on patch by cirdan) 12 years ago
rubidium 060cac439c (svn r23942) -Fix: infrastructure cache of standard road stops would get messed up when buying a company with them 13 years ago
rubidium 30c3850225 (svn r23851) -Fix: infrastructure cache could get out of sync when overbuilding a drive through road stop 13 years ago
michi_cc 52b951ca6f (svn r23844) -Fix (r23414): Infrastructure count for stations wasn't updated properly on company takeover. And don't count buoys while loading a game either. 13 years ago
rubidium f6487875da (svn r23838) -Fix [FS#5000]: assertion got hit when destroing a dock when a ship was loading 13 years ago