Commit Graph
520 Commits
Author SHA1 Message Date
SamuXarickandGitHub 8da5cff210 Fix #8462: Don't check whether to grow a town road on water (#8471) 2021-01-09 12:18:31 +01:00
Patric StoutandGitHub 8e6574dcdb Revert 78f92130: "Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535)" (#8541)
As per https://github.com/OpenTTD/OpenTTD/pull/8535#issuecomment-757122918,
jumped the gun here.
2021-01-09 12:14:23 +01:00
Tyler TrahanandGitHub b0456669c9 Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535) 2021-01-09 10:06:31 +01:00
Tyler TrahanandGitHub b08c66a796 Fix 7bdfb38: Drive-thru road stations can be connected at either end (#8528) 2021-01-08 18:56:39 +01:00
Tyler TrahanandGitHub 9c0da686da Add: Towns can build tunnels (#8473) 2021-01-08 18:32:44 +01:00
Charles PigottandGitHub 9b800a96ed Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Patric StoutandGitHub c7609e767f Fix #7604: prevent houses to wander too far from town center when rebuilding (#8507)
When a multi-tile house is rebuild, it always used the most northern
tile to build the new house. This can very easily lead to houses
wandering off in the north-ish direction (either NW or NE).

To prevent this, pick the tile closest to town center when rebuilding
on a multi-tile house. This still means a house can be build away
from a road, but it is no longer wandering around finding another
town to call home.
2021-01-07 08:01:23 +01:00
Patric StoutandPatric Stout a4e34e824c Change: towns can now bridge 4 rails (up from 3)
Having 4 rails is a pretty common design, and towns now couldn't
bridge out of this common design.
2021-01-06 21:39:34 +01:00
Didac Perez PareraandPatric Stout 64eddaeb49 Feature: Make maximum length of town bridges depend on population. 2021-01-06 21:39:34 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Tyler TrahanandGitHub 7bdfb382a8 Change: Towns don't build dead-end road bridges (#8401) 2020-12-25 00:37:13 +01:00
dPandNiels Martin Hansen 7045186594 Change #8159: Remove now unused town cargo caches without bumping the savegame version 2020-06-28 18:23:59 +02:00
YexoandYexo a82572d0f5 Codechange: remove has_newhouses global 2020-06-01 22:46:06 +02:00
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 2020-05-21 20:02:34 +02:00
dPandCharles Pigott 93d1d8773f Fix: Desync after house replacement 2020-05-18 09:05:39 +01:00
dPandCharles Pigott f2a9a1e2a5 Fix #8137: New clients can't join (desync) after funding an industry 2020-05-13 08:43:01 +01:00
dPandCharles Pigott 7bd52970a1 Codechange: Refactor FindStationsAroundTiles to avoid code duplication 2020-05-13 08:43:01 +01:00
Jonathan G RennisonandCharles Pigott c3223903ed Codechange: Cache resolved town, station and industry name strings 2020-01-12 19:37:43 +00:00
Jonathan G RennisonandCharles Pigott 22ba048c89 Change: Only resort town directory window on population change if necessary 2020-01-12 19:37:43 +00:00
glxandCharles Pigott 39e6247bec Fix #7899, 196d5868: don't trigger filter changes more than expected 2020-01-05 22:51:27 +00:00
Niels Martin Hansen f401622149 Feature: Script API to change town rating of companies 2020-01-04 19:07:13 +01:00
glxandNiels Martin Hansen ee7a8eebca Codechange: Replace FOR_ALL_TOWNS with range-based for loops 2019-12-21 20:13:03 +01:00
glxandNiels Martin Hansen 514565fad6 Codechange: Replace FOR_ALL_OBJECTS with range-based for loops 2019-12-21 20:13:03 +01:00
glxandNiels Martin Hansen 00c2a98cf3 Codechange: Replace FOR_ALL_INDUSTRIES with range-based for loops 2019-12-21 20:13:03 +01:00
glxandNiels Martin Hansen fa9769f81a Codechange: Replace FOR_ALL_DEPOTS with range-based for loops 2019-12-21 20:13:03 +01:00
glxandNiels Martin Hansen ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
glxandNiels Martin Hansen 3a14cea068 Codechange: Replace FOR_ALL_COMPANIES with range-based for loops 2019-12-21 20:13:03 +01:00
Niels Martin HansenandGitHub 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.
2019-12-01 23:17:33 +01:00
froschandCharles Pigott 61dba850af Revert #7837, 7e22f243e: OpenTTD tries to replicate the original game mechanics.
Making numbers look nice and correlate is no goal, and in this case they actually did not correlate.
2019-11-20 08:01:37 +00:00
YourselfandIngo von Borstel 7e22f243ed Fix: typo in town growth rates (#7837) 2019-11-18 16:20:47 +01:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
GabdaandCharles Pigott b870596f15 Add #6887: Option to show zone inside local authority boundary of towns
Can be found at town information > local authority window
Layout for button is same as Graph Keys
Turn on/off for every town individually
2019-08-17 21:45:20 +01:00
peter1138andMichael Lutz c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Charles PigottandPeterN 5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Charles PigottandPeterN f20b75d712 Codechange: Remove TownLayoutByte type 2019-04-29 17:40:22 +01:00
Henry WilsonandMichael Lutz 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Niels Martin Hansen cebdd72146 Fix #7440: Remove town sign when deleting town, not add it once more 2019-04-02 09:46:33 +02:00
Henry WilsonandPeterN cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry WilsonandPeterN bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 2019-03-26 20:15:57 +00:00
GabdaandPeterN dea7f078f4 Codechange: Update town sign on population change only when population is shown (#7368) 2019-03-12 19:12:34 +00:00
Niels Martin Hansen e8d397e4ee Codechange: Make a merged k-d tree index of all viewport signs 2019-03-09 20:27:11 +01:00
Niels Martin Hansen d84b67e54d Codechange: Make a k-d tree index of stations 2019-03-09 20:27:11 +01:00
Niels Martin Hansen 7b56be0f3a Codechange: Make a k-d tree index of towns 2019-03-09 20:27:11 +01:00
Peter NelsonandPeterN 8b1b3fd0f9 Feature: Non-rectangular sparse station catchment area. 2019-03-09 16:33:47 +00:00
Niels Martin Hansen 52572cafa6 Add: Option for population-linear town cargo generation
Introduce a new default algorithm for town cargo generation (passengers and mail), and a game setting to choose between the new and original algorithm.

The original town cargo generation algorithm has the property of the generated amount relating to the square of each building's population, meaning large towns easily produce more cargo than can realistically be transported. The problem is excessive cargo is amplified if playing with cargodist.

The new algorithm introduced instead has a linear relation to the population. The result is that smaller towns will produce slightly more cargo, while the largest towns will produce about a fourth of what they would with the original algorithm.

Existing savegames will use the original algorithm, while new games will default to the new algorithm.
2019-03-04 20:19:44 +01:00
PeterNandGitHub ebc3934ee6 Fix #7043, Fix #7274: Delete town owned bridge based on adjacent tile ownership, not nearest town. (#7284)
This only affects failed town generation, as towns do not delete bridges under any other circumstances.

The existing test performed badly with a large number of towns due to having to calculate the
nearest town, and also by its nature assumed a bridge was built by the nearest town, leading
to bridges of nearby large towns be removed incorrectly.

If we gain the ability to quickly retrieve the correct town (which is _not_ the nearest town) from the bridge, this change should be reviewed.
2019-03-03 22:28:55 +00:00
SamuXarickandPeterN 50a0cf1915 Change: Allow towns to build bridges over rails and one-way roads. (#7291) 2019-02-28 17:45:17 +00:00
Niels Martin Hansen 48b334cf97 Add: Houses can accept up to 16 different cargo types via NewGRF.
New Action0 property 23 for feature 07, variable length, format B n*(B B). Initial byte is number of structures following. First byte in structure is cargo id, second is acceptance level in 1/8 units.
2019-01-21 16:06:25 +01:00
nikolasandCharles Pigott d8ccad91f9 Fix: Some code and comment typos
Found with codespell
2019-01-17 22:01:07 +00:00
Joan JosepandCharles Pigott 9aecbac2b4 Codechange: Define INVALID_TOWN as a TownID (#7044) 2019-01-12 23:20:10 +00:00