diff --git a/.changelog b/.changelog
index e69de29bb2..9b73a61c81 100644
--- a/.changelog
+++ b/.changelog
@@ -0,0 +1,105 @@
+12.0-beta2 (2021-08-19)
+------------------------------------------------------------------------
+Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo (#9457)
+Fix: Wrong town window refreshed when building an airport with noise levels enabled (#9497)
+Fix: Improve wording of network-related messages (#9494, #9495, #9500)
+Fix: [Network] Report reuse of invite-code (#9487)
+Fix: [Network] Connecting with the same client name thrice hangs the server (#9485)
+
+
+12.0-beta1 (2021-08-15)
+------------------------------------------------------------------------
+Feature: [Network] Remove lobby window; pressing "Join Game" now immediately joins a server (#9467)
+Feature: [Network] Synchronize server name to clients and display in Online Players window (#9472)
+Feature: [Network] Mention you are a spectator in the status bar (#9471)
+Feature: [Network] No longer require port-forwarding to host a server (#9443, #9447)
+Feature: [Network] Allow setting your server visibility to "invite-only" (#9434)
+Feature: [Network] Join servers based on their invite code (#9432)
+Feature: Raise the maximum NewGRF limit to 255 (#9428)
+Feature: Persistent rotation of numbered auto/netsave after restart (#9395, #9397)
+Feature: [NewGRF] Maximum curve speed modifier for rail vehicles (#9346)
+Feature: Move sensitive information to secrets.cfg and private information to private.cfg (#9298)
+Feature: Signed Windows builds (#9294)
+Feature: [NewGRF] Define refittability of default vehicles using cargo classes (#9148)
+Feature: Configurable subsidy duration, up to 5000 years (#9081)
+Feature: [Network] Rework in-game Online Players window (#9067)
+Feature: [Network] Show previous chat history when the chat message box is open (#9025)
+Feature: Button to reset game settings to their default values (#8958)
+Feature: Press Ctrl to build diagonal rivers in Scenario Editor (#8880)
+Feature: Set wagon replacement per group when using autoreplace (#7441)
+Add: [Network] Open Online Players window on starting/joining a server (#9479)
+Add: [Script] Basic information about loaded NewGRFs for scripts (#9464)
+Add: [AI] Get the number of vehicles in a given group (#9462)
+Add: [Network] Inform network clients what game-script a server is running (#9441)
+Add: Hindi translation (#9086)
+Add: [Network] Ensure players fill in a name instead of defaulting to "Player" (#9080)
+Change: Allow pause/unpause console command in single player (#9342)
+Change: Make savegame format self-descriptive and consistent across all objects (#9322, #9335, #9338, #9339)
+Change: By default, make "unload all" leave stations empty (#9301)
+Change: Reworked the debug levels and messages for network logs (#9230, #9251)
+Change: [Emscripten] Set default scrolling mode to non-pointer-locking (#9191)
+Change: Use neutral pronouns for various strings (#9189, #9203, #9228)
+Change: Make the town directory horizontally resizable (#9157)
+Change: Allow non-ASCII currency separators (#9121)
+Change: [NewGRF] Display a pop-up window for Errors with severity ERROR (#9119)
+Change: Treat languages as finished, if translations are 75% completed (#9019, #9086)
+Change: Disable NewGRF window apply button if no change was made (#8934)
+Fix: [Script] Crash when iterating lists of which the key is larger than 32bit (#9465)
+Fix: [Network] Desync due to use of unstable sort when distributing cargo production (#9460)
+Fix #9440: Negative cargo payments not being handled correctly (#9455)
+Fix: [Network] Crash when joining a server again after a TCP disconnect (#9453)
+Fix: Don't enable rename button for network clients in build vehicle window (#9452)
+Fix: Money could underflow and wrap around (#9451)
+Fix: Parse the console settings the same way as config settings (#9438)
+Fix: Ensure no more than the allowed number of NewGRFs are loaded from the configuration (#9430)
+Fix: [NewGRF] Overflow when determining cargo mask for string code 9A 1E (#9423)
+Fix: Integers for scripts are 64bit, but saved as 32bit (#9415)
+Fix #9392: [Script] Return a valid value with GetBuildWithRefitCapacity even when AIs are maxed out in vehicles (#9393)
+Fix #8169: Crash when autoreplacing vehicle with no orders (#9387)
+Fix: Wrong cargo line position in IndustryCargo window (#9383)
+Fix: Race-condition during startup of NewGRF scan (#9382)
+Fix: Don't propagate Shift/Ctrl state till next game-tick (#9381)
+Fix: Prevent palette updates during copying to the video driver (#9379)
+Fix: [Network] Determining GetNetworkRevisionString could overflow and underflow its buffer (#9372)
+Fix #9358: Don't skip empty files in tar archives (#9367)
+Fix: For old savegames, station bus/truck station cache was not updated (#9366)
+Fix #9353: [Script] Garbage collecting on priority queues could crash the game (#9356)
+Fix: Respect the autosave_on_exit setting for Null video driver (#9343)
+Fix: Compatible NewGRFs in crash-log reported wrong MD5 hash (#9340)
+Fix: [Script] Ensure the saved script strings are properly validated and terminated (#9336)
+Fix #9316: Town bridge length limit check incorrect above 250k inhabitants (#9318)
+Fix: Limit heightmap sizes to 8192x8192 (#9307)
+Fix #9281: Money generating exploit when buying out a company (#9300)
+Fix: Part of a tile might not be redrawn when terraforming (#9296)
+Fix: [OpenGL] Increase timeout when waiting for the GPU to be done with the drawing buffer (#9282)
+Fix: Vehicles sent in the wrong direction if there is no path to the destination (#9280)
+Fix #9264: Do not attach temporary wagons to free wagon chains when autoreplacing (#9278)
+Fix #9267: [Script] Crash during garbage collection (#9275)
+Fix: Encountering two-way red signals could prune unrelated Pathfinder branches (#9271)
+Fix #9255: [Network] Crash when hostname is not found (#9259)
+Fix #9256: Invalid read after free when replacing train chains (#9258)
+Fix: [Emscripten] Force secure WebSockets over HTTPS (#9248)
+Fix #9242: Tree tick handler did not scale by map size (#9246)
+Fix: [Network] Mark server as offline when no longer reachable (#9244)
+Fix: [Network] Don't rebuild the host-list during iterating the list (#9240)
+Fix: [Network] Don't mark the last-joined server as a manually added server (#9239)
+Fix: [Network] Clients leaving because of broken connections was not broadcasted (#9238)
+Fix: [Network] Check on CIDR for netmask check considered everything valid (#9235)
+Fix: Creating screenshots on dedicated servers failed (#9232)
+Fix: Leaking file descriptors for downloaded content (#9229)
+Fix: Spelling of several town names (#9222)
+Fix #9209: Game hangs when resizing highscore/news window if the screen is too small (#9210)
+Fix: [Network] Optimize creating network connections for clients using IPv4 and IPv6 (#9199)
+Fix #9186: Fix incorrect bounding box height causing station sprite glitch (#9187)
+Fix: Truncating strings in settings could leave invalid UTF-8 characters (#9121)
+Fix: Many issues related to window scaling (#9087, #9219)
+Fix: Invalidate cached vehicle colourmaps when changing liveries setting (#9006)
+Fix #8981: Don't attempt to re-reserve path if already entering/entered depot (#9000)
+Fix: Missing 'Town names:' colon in map gen GUI (#8986)
+Fix: Sorting and filtering industries that produce/accept many cargoes (#8468)
+Remove: [Network] COMPANY_INFO packets (#9475)
+Remove: [Network] A server can no longer set a limit to the amount of spectators allowed (#9466)
+Remove: Arbitrary limit on number of statically loaded NewGRFs (#9431)
+Remove: [Network] Language and map-name from server information (#9070)
+
+
diff --git a/.github/changelog.sh b/.github/changelog.sh
index ea0da948c1..b057ad475f 100755
--- a/.github/changelog.sh
+++ b/.github/changelog.sh
@@ -4,9 +4,9 @@ tag=$(git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed 's@\
# If we are a tag, show the part of the changelog till (but excluding) the last stable
if [ -n "$tag" ]; then
- grep='^[0-9]\+\.[0-9]\+\.[0-9]\+[^-]'
+ grep='^[0-9]\+\.[0-9]\+[^-]'
next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
- cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
+ cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
exit 0
fi
diff --git a/.ottdrev b/.ottdrev
index a8b23e570e..14a9dc1069 100644
--- a/.ottdrev
+++ b/.ottdrev
@@ -1 +1 @@
-12.0-beta1 20210815 0 b67ef1e5b85cda0af8be0c7d99b8b00b5ec05ebb 1 0 2021
+12.0-beta2 20210819 0 778e196b55265c40191186c273b008356136e20d 1 0 2021
diff --git a/.release_date b/.release_date
index ac19647937..1f03624b00 100644
--- a/.release_date
+++ b/.release_date
@@ -1 +1 @@
-2021-08-15 11:15 UTC
+2021-08-19 19:24 UTC
diff --git a/.version b/.version
index e6dc9a70ae..79a8a39288 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-12.0-beta1
+12.0-beta2
diff --git a/changelog.txt b/changelog.txt
index a661cab6ec..883560397e 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,12 @@
+12.0-beta2 (2021-08-19)
+------------------------------------------------------------------------
+Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo (#9457)
+Fix: Wrong town window refreshed when building an airport with noise levels enabled (#9497)
+Fix: Improve wording of network-related messages (#9494, #9495, #9500)
+Fix: [Network] Report reuse of invite-code (#9487)
+Fix: [Network] Connecting with the same client name thrice hangs the server (#9485)
+
+
12.0-beta1 (2021-08-15)
------------------------------------------------------------------------
Feature: [Network] Remove lobby window; pressing "Join Game" now immediately joins a server (#9467)
diff --git a/docs/landscape_grid.html b/docs/landscape_grid.html
index 7eac768591..fc0c6e0cfc 100644
--- a/docs/landscape_grid.html
+++ b/docs/landscape_grid.html
@@ -79,7 +79,7 @@ the array so you can quickly see what is used and what is not.
| 0 |
ground |
- XXXX XX XX |
+ XXXX XX XX |
XXXX XXXX |
OOO1 OOOO |
OOOO OOOO OOOO OOOO |
diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp
index 0baeb32d50..38f6d62e59 100644
--- a/src/gfx_layout.cpp
+++ b/src/gfx_layout.cpp
@@ -888,6 +888,12 @@ Layouter::LineCacheItem &Layouter::GetCachedParagraphLayout(const char *str, siz
linecache = new LineCache();
}
+ if (auto match = linecache->find(LineCacheQuery{state, std::string_view{str, len}});
+ match != linecache->end()) {
+ return match->second;
+ }
+
+ /* Create missing entry */
LineCacheKey key;
key.state_before = state;
key.str.assign(str, len);
diff --git a/src/gfx_layout.h b/src/gfx_layout.h
index f26545ee4a..a5efb9d80f 100644
--- a/src/gfx_layout.h
+++ b/src/gfx_layout.h
@@ -17,6 +17,8 @@
#include