Merge branch 'master' into jgrpp

# Conflicts:
#	src/network/network.cpp
#	src/pathfinder/yapf/yapf.h
#	src/pathfinder/yapf/yapf_ship.cpp
#	src/saveload/afterload.cpp
#	src/ship_cmd.cpp
#	src/station_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
pull/715/head
Jonathan G Rennison 3 months ago
commit 15f4e62936

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.42
image: emscripten/emsdk:3.1.57
steps:
- name: Checkout
@ -30,12 +30,11 @@ jobs:
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
key: 3.1.57-${{ runner.os }}
- name: Patch Emscripten to support LZMA
- name: Add liblzma support
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
cp ${GITHUB_WORKSPACE}/os/emscripten/ports/liblzma.py /emsdk/upstream/emscripten/tools/ports/contrib/
- name: Build (host tools)
run: |

@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.42
image: emscripten/emsdk:3.1.57
steps:
- name: Checkout
@ -38,12 +38,11 @@ jobs:
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
key: 3.1.57-${{ runner.os }}
- name: Patch Emscripten to support LZMA
- name: Add liblzma support
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
cp ${GITHUB_WORKSPACE}/os/emscripten/ports/liblzma.py /emsdk/upstream/emscripten/tools/ports/contrib/
- name: Build (host tools)
run: |

@ -195,10 +195,11 @@ Last updated: 2014-02-23
'src/network/network_func.h'.
(DEBUG_FAILED_DUMP_COMMANDS is explained later)
- Put the 'commands-out.log' into the root save folder, and rename
it to 'commands.log'.
- Run 'openttd -D -d desync=3 -g startsavegame.sav'.
This replays the server log and creates new 'commands-out.log'
and 'dmp_cmds_*.sav' in your autosave folder.
it to 'commands.log'. Strip everything and including the "newgame"
entry from the log.
- Run 'openttd -D -d desync=0 -g startsavegame.sav'.
This replays the server log. Use "-d desync=3" to also create a
new 'commands-out.log' and 'dmp_cmds_*.sav' in your autosave folder.
## 3.2) Evaluation of the replay
@ -226,7 +227,7 @@ Last updated: 2014-02-23
savegames with your own ones from the replay. You can also comment/disable
the 'NOT_REACHED' mentioned above, to get another 'dmp_cmds_*.sav' from
the replay after the mismatch has already been detected.
See Section 3.2 on how to compare savegames.
See Section 3.3 on how to compare savegames.
If the saves differ you have located the Desync between the last dmp_cmds
that match and the first one that does not. The difference of the saves
may point you in the direction of what causes it.
@ -252,16 +253,14 @@ Last updated: 2014-02-23
are replayed. Their internal state will thus not change in the
replay and will differ.
To compare savegame more semantically, there exist some ugly hackish
tools at:
http://devs.openttd.org/~frosch/texts/zpipe.c
http://devs.openttd.org/~frosch/texts/printhunk.c
To compare savegame more semantically, easiest is to first export them
to a JSON format with for example:
The first one decompresses OpenTTD savegames. The second one creates
a textual representation of an uncompressed savegame, by parsing hunks
and arrays and such. With both tools you need to be a bit careful
since they work on stdin and stdout, which may not deal well with
binary data.
https://github.com/TrueBrain/OpenTTD-savegame-reader
If you have the textual representation of the savegames, you can
compare them with regular diff tools.
By running:
python -m savegame_reader --export-json dmp_cmds_NNN.sav | jq . > NNN.json
Now you can use any (JSON) diff tool to compare the two savegames in a
somewhat human readable way.

@ -29,20 +29,25 @@ This guide is for OpenTTD developers/maintainers, to release a new version of Op
1. Go to https://github.com/OpenTTD/website/new/main/_posts and write a new announcement post. See a [previous example](https://github.com/OpenTTD/website/pull/238) for a template.
2. Create a new branch for this post and open a PR for it.
3. Write announcement text for socials like Forum/Discord/Twitter/Reddit and include it in the PR.
3. Write announcement text for the store pages and socials like TT-Forums / Discord / Twitter / Reddit / Fosstodon / etc., and include it in the PR.
4. Create a Steam news image for that post and include it in the PR.
5. Check the website post (preview link via checks page) and make corrections. We usually just use the GitHub web interface for this and squash the result later.
5. Check the website post ("View Deployment" link) and make corrections. We usually just use the GitHub web interface for this and squash the result later.
6. Get this PR approved, but do not merge yet.
## Step 3: Make the actual OpenTTD release
1. Go to https://github.com/OpenTTD/OpenTTD/releases/new and create a new tag matching the release number. For the body of the release, see any older release. "Set as a pre-release" for a beta or RC, set as latest for a real release.
2. Merge website PR.
3. Wait for the OpenTTD release checks to be complete.
4. Check that website links to the new release are working and correct, using the [staging website](https://www-staging.openttd.org/).
5. If this is a full release, ask orudge to update the Microsoft Store and TrueBrain to move the release from the "testing" to "default" branch on Steam.
1. Go to https://github.com/OpenTTD/OpenTTD/releases/new and create a new tag matching the release number. For the body of the release, copy in the changelog. "Set as a pre-release" for a beta or RC.
2. Wait for the OpenTTD release workflow to be complete.
3. Merge the website PR. This will publish the release post.
4. If this is a full release:
* for `Steam`: under Steamworks -> SteamPipe -> Builds, set the "testing" branch live on the "default" branch. This will request 2FA validation.
* for `GOG`: under Builds, "Publish" the freshly uploaded builds to `Master`, `GOG-use only` and `Testing`.
* for `Microsoft Store`: ask orudge to publish the new release.
Access to `Steam`, `GOG` and/or `Microsoft Store` requires a developer account on that platform.
You will need access to the shared keystore in order to create such an account.
For help and/or access to either or both, please contact TrueBrain.
## Step 4: Tell the world
1. Tag and create a website release to trigger the actions that update the website.
2. After the website is live, make announcements on social media. You may need to coordinate with other developers who can make posts on Twitter, Reddit, Steam, and GOG.
1. Make announcements on social media and store pages. You may need to coordinate with other developers who can make posts on TT-Forums, Twitter, Reddit, Fosstodon, Discord, Steam, GOG, Microsoft Store, etc.

@ -1,4 +1,3 @@
FROM emscripten/emsdk:3.1.42
FROM emscripten/emsdk:3.1.57
COPY emsdk-liblzma.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
COPY ports/liblzma.py /emsdk/upstream/emscripten/tools/ports/contrib/liblzma.py

@ -2,8 +2,8 @@
Please use docker with the supplied `Dockerfile` to build for emscripten.
It takes care of a few things:
- Use a version of emscripten we know works
- Patch in LibLZMA support (as this is not supported by upstream)
- Use a version of emscripten we know works.
- Add LibLZMA library under contrib ports.
First, build the docker image by navigating in the folder this `README.md` is in, and executing:
```

@ -1,7 +1,7 @@
# LibLZMA is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports LibLZMA.
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-sUSE_LIBLZMA=1")
set(CMAKE_REQUIRED_FLAGS "--use-port=contrib.liblzma")
check_cxx_source_compiles("
#include <lzma.h>
@ -12,9 +12,9 @@ check_cxx_source_compiles("
if (LIBLZMA_FOUND)
add_library(LibLZMA::LibLZMA INTERFACE IMPORTED)
set_target_properties(LibLZMA::LibLZMA PROPERTIES
INTERFACE_COMPILE_OPTIONS "-sUSE_LIBLZMA=1"
INTERFACE_LINK_LIBRARIES "-sUSE_LIBLZMA=1"
INTERFACE_COMPILE_OPTIONS "--use-port=contrib.liblzma"
INTERFACE_LINK_LIBRARIES "--use-port=contrib.liblzma"
)
else()
message(WARNING "You are using an emscripten SDK without LibLZMA support. Many savegames won't be able to load in OpenTTD. Please apply 'emsdk-liblzma.patch' to your local emsdk installation.")
message(WARNING "You are using an emscripten SDK without LibLZMA support. Many savegames won't be able to load in OpenTTD. Please copy liblzma.py to your ports/contrib folder in your local emsdk installation.")
endif()

@ -1,198 +0,0 @@
From 84d0e9112d5c87a714abd21ec8547921f46f37b5 Mon Sep 17 00:00:00 2001
From: milek7 <me@milek7.pl>
Date: Tue, 8 Dec 2020 01:03:31 +0100
Subject: [PATCH] Add liblzma port
---
src/settings.js | 4 ++
tools/ports/liblzma.py | 151 +++++++++++++++++++++++++++++++++++++++++
tools/settings.py | 1 +
3 files changed, 156 insertions(+)
create mode 100644 tools/ports/liblzma.py
diff --git a/src/settings.js b/src/settings.js
index f93140d..7b6bec9 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -1451,6 +1451,10 @@ var USE_GIFLIB = false;
// [compile+link]
var USE_LIBJPEG = false;
+// 1 = use liblzma from emscripten-ports
+// [compile+link]
+var USE_LIBLZMA = false;
+
// 1 = use libpng from emscripten-ports
// [compile+link]
var USE_LIBPNG = false;
diff --git a/tools/ports/liblzma.py b/tools/ports/liblzma.py
new file mode 100644
index 0000000..6872a8b
--- /dev/null
+++ b/tools/ports/liblzma.py
@@ -0,0 +1,151 @@
+# Copyright 2020 The Emscripten Authors. All rights reserved.
+# Emscripten is available under two separate licenses, the MIT license and the
+# University of Illinois/NCSA Open Source License. Both these licenses can be
+# found in the LICENSE file.
+
+import os
+import shutil
+import logging
+from pathlib import Path
+
+VERSION = '5.4.2'
+HASH = '149f980338bea3d66de1ff5994b2b236ae1773135eda68b62b009df0c9dcdf5467f8cb2c06da95a71b6556d60bd3d21f475feced34d5dfdb80ee95416a2f9737'
+
+
+def needed(settings):
+ return settings.USE_LIBLZMA
+
+
+def get(ports, settings, shared):
+ ports.fetch_project('liblzma', f'https://tukaani.org/xz/xz-{VERSION}.tar.gz', sha512hash=HASH)
+
+ def create(final):
+ logging.info('building port: liblzma')
+
+ ports.clear_project_build('liblzma')
+
+ source_path = os.path.join(ports.get_dir(), 'liblzma', f'xz-{VERSION}', 'src', 'liblzma')
+ ports.write_file(os.path.join(source_path, 'config.h'), config_h)
+ ports.install_headers(os.path.join(source_path, 'api'), pattern='lzma.h')
+ ports.install_headers(os.path.join(source_path, 'api', 'lzma'), pattern='*.h', target='lzma')
+
+ build_flags = ['-DHAVE_CONFIG_H', '-DTUKLIB_SYMBOL_PREFIX=lzma_', '-fvisibility=hidden']
+ exclude_files = ['crc32_small.c', 'crc64_small.c', 'crc32_tablegen.c', 'crc64_tablegen.c', 'price_tablegen.c', 'fastpos_tablegen.c',
+ 'tuklib_exit.c', 'tuklib_mbstr_fw.c', 'tuklib_mbstr_width.c', 'tuklib_open_stdxxx.c', 'tuklib_progname.c']
+ include_dirs_rel = ['../common', 'api', 'check', 'common', 'delta', 'lz', 'lzma', 'rangecoder', 'simple']
+
+ include_dirs = [os.path.join(source_path, p) for p in include_dirs_rel]
+ ports.build_port(source_path, final, 'liblzma', flags=build_flags, exclude_files=exclude_files, includes=include_dirs)
+
+ return [shared.cache.get_lib('liblzma.a', create, what='port')]
+
+
+def clear(ports, settings, shared):
+ shared.cache.erase_lib('liblzma.a')
+
+
+def process_args(ports):
+ return []
+
+
+def show():
+ return 'liblzma (USE_LIBLZMA=1; public domain)'
+
+
+config_h = '''
+#define ASSUME_RAM 128
+#define ENABLE_NLS 1
+#define HAVE_CHECK_CRC32 1
+#define HAVE_CHECK_CRC64 1
+#define HAVE_CHECK_SHA256 1
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_DCGETTEXT 1
+#define HAVE_DECL_CLOCK_MONOTONIC 1
+#define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
+#define HAVE_DECODERS 1
+#define HAVE_DECODER_ARM 1
+#define HAVE_DECODER_ARMTHUMB 1
+#define HAVE_DECODER_DELTA 1
+#define HAVE_DECODER_IA64 1
+#define HAVE_DECODER_LZMA1 1
+#define HAVE_DECODER_LZMA2 1
+#define HAVE_DECODER_POWERPC 1
+#define HAVE_DECODER_SPARC 1
+#define HAVE_DECODER_X86 1
+#define HAVE_DLFCN_H 1
+#define HAVE_ENCODERS 1
+#define HAVE_ENCODER_ARM 1
+#define HAVE_ENCODER_ARMTHUMB 1
+#define HAVE_ENCODER_DELTA 1
+#define HAVE_ENCODER_IA64 1
+#define HAVE_ENCODER_LZMA1 1
+#define HAVE_ENCODER_LZMA2 1
+#define HAVE_ENCODER_POWERPC 1
+#define HAVE_ENCODER_SPARC 1
+#define HAVE_ENCODER_X86 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FUTIMENS 1
+#define HAVE_GETOPT_H 1
+#define HAVE_GETOPT_LONG 1
+#define HAVE_GETTEXT 1
+#define HAVE_IMMINTRIN_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MBRTOWC 1
+#define HAVE_MEMORY_H 1
+#define HAVE_MF_BT2 1
+#define HAVE_MF_BT3 1
+#define HAVE_MF_BT4 1
+#define HAVE_MF_HC3 1
+#define HAVE_MF_HC4 1
+#define HAVE_OPTRESET 1
+#define HAVE_POSIX_FADVISE 1
+#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
+#define HAVE_PTHREAD_PRIO_INHERIT 1
+#define HAVE_STDBOOL_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_UINTPTR_T 1
+#define HAVE_UNISTD_H 1
+#define HAVE_VISIBILITY 1
+#define HAVE_WCWIDTH 1
+#define HAVE__BOOL 1
+#define HAVE___BUILTIN_ASSUME_ALIGNED 1
+#define HAVE___BUILTIN_BSWAPXX 1
+#define MYTHREAD_POSIX 1
+#define NDEBUG 1
+#define PACKAGE "xz"
+#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
+#define PACKAGE_NAME "XZ Utils"
+#define PACKAGE_STRING "XZ Utils 5.4.0"
+#define PACKAGE_TARNAME "xz"
+#define PACKAGE_VERSION "5.4.0"
+#define SIZEOF_SIZE_T 4
+#define STDC_HEADERS 1
+#define TUKLIB_CPUCORES_SYSCONF 1
+#define TUKLIB_FAST_UNALIGNED_ACCESS 1
+#define TUKLIB_PHYSMEM_SYSCONF 1
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+#define VERSION "5.4.0"
+'''
diff --git a/tools/settings.py b/tools/settings.py
index 10d6ca0..827e4a9 100644
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -40,6 +40,7 @@ PORTS_SETTINGS = {
'USE_SDL_NET',
'USE_SDL_GFX',
'USE_LIBJPEG',
+ 'USE_LIBLZMA',
'USE_OGG',
'USE_REGAL',
'USE_BOOST_HEADERS',
--
2.34.1

@ -0,0 +1,139 @@
import os
import logging
VERSION = '5.4.6'
HASH = '495cc890d25c075c927c907b77e60d86dd8a4c377cea5b1172c8e916984149a7bb5fb32db25091f7219346b83155b47e4bc0404cc8529d992014cd7ed0c278b7'
URL = 'https://github.com/tukaani-project/xz'
DESCRIPTION = 'liblzma provides a general-purpose data-compression library.'
LICENSE = 'LGPL-2.1'
def get(ports, settings, shared):
ports.fetch_project('contrib.liblzma', f'https://github.com/tukaani-project/xz/releases/download/v{VERSION}/xz-{VERSION}.tar.xz', sha512hash=HASH)
def create(final):
logging.info('building port: contrib.liblzma')
ports.clear_project_build('contrib.liblzma')
source_path = os.path.join(ports.get_dir(), 'contrib.liblzma', f'xz-{VERSION}', 'src', 'liblzma')
ports.write_file(os.path.join(source_path, 'config.h'), config_h)
ports.install_headers(os.path.join(source_path, 'api'), pattern='lzma.h')
ports.install_headers(os.path.join(source_path, 'api', 'lzma'), pattern='*.h', target='lzma')
build_flags = ['-DHAVE_CONFIG_H', '-DTUKLIB_SYMBOL_PREFIX=lzma_', '-fvisibility=hidden']
exclude_files = ['crc32_small.c', 'crc64_small.c', 'crc32_tablegen.c', 'crc64_tablegen.c', 'price_tablegen.c', 'fastpos_tablegen.c',
'tuklib_exit.c', 'tuklib_mbstr_fw.c', 'tuklib_mbstr_width.c', 'tuklib_open_stdxxx.c', 'tuklib_progname.c']
include_dirs_rel = ['../common', 'api', 'check', 'common', 'delta', 'lz', 'lzma', 'rangecoder', 'simple']
include_dirs = [os.path.join(source_path, p) for p in include_dirs_rel]
ports.build_port(source_path, final, 'contrib.liblzma', flags=build_flags, exclude_files=exclude_files, includes=include_dirs)
return [shared.cache.get_lib('liblzma.a', create, what='port')]
def clear(ports, settings, shared):
shared.cache.erase_lib('liblzma.a')
def process_args(ports):
return []
config_h = '''
#define ASSUME_RAM 128
#define ENABLE_NLS 1
#define HAVE_CHECK_CRC32 1
#define HAVE_CHECK_CRC64 1
#define HAVE_CHECK_SHA256 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_DCGETTEXT 1
#define HAVE_DECL_CLOCK_MONOTONIC 1
#define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
#define HAVE_DECODERS 1
#define HAVE_DECODER_ARM 1
#define HAVE_DECODER_ARMTHUMB 1
#define HAVE_DECODER_DELTA 1
#define HAVE_DECODER_IA64 1
#define HAVE_DECODER_LZMA1 1
#define HAVE_DECODER_LZMA2 1
#define HAVE_DECODER_POWERPC 1
#define HAVE_DECODER_SPARC 1
#define HAVE_DECODER_X86 1
#define HAVE_DLFCN_H 1
#define HAVE_ENCODERS 1
#define HAVE_ENCODER_ARM 1
#define HAVE_ENCODER_ARMTHUMB 1
#define HAVE_ENCODER_DELTA 1
#define HAVE_ENCODER_IA64 1
#define HAVE_ENCODER_LZMA1 1
#define HAVE_ENCODER_LZMA2 1
#define HAVE_ENCODER_POWERPC 1
#define HAVE_ENCODER_SPARC 1
#define HAVE_ENCODER_X86 1
#define HAVE_FCNTL_H 1
#define HAVE_FUTIMENS 1
#define HAVE_GETOPT_H 1
#define HAVE_GETOPT_LONG 1
#define HAVE_GETTEXT 1
#define HAVE_IMMINTRIN_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MBRTOWC 1
#define HAVE_MEMORY_H 1
#define HAVE_MF_BT2 1
#define HAVE_MF_BT3 1
#define HAVE_MF_BT4 1
#define HAVE_MF_HC3 1
#define HAVE_MF_HC4 1
#define HAVE_OPTRESET 1
#define HAVE_POSIX_FADVISE 1
#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
#define HAVE_PTHREAD_PRIO_INHERIT 1
#define HAVE_STDBOOL_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UINTPTR_T 1
#define HAVE_UNISTD_H 1
#define HAVE_VISIBILITY 1
#define HAVE_WCWIDTH 1
#define HAVE__BOOL 1
#define HAVE___BUILTIN_ASSUME_ALIGNED 1
#define HAVE___BUILTIN_BSWAPXX 1
#define MYTHREAD_POSIX 1
#define NDEBUG 1
#define PACKAGE "xz"
#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
#define PACKAGE_NAME "XZ Utils"
#define PACKAGE_STRING "XZ Utils 5.4.0"
#define PACKAGE_TARNAME "xz"
#define PACKAGE_VERSION "5.4.0"
#define SIZEOF_SIZE_T 4
#define STDC_HEADERS 1
#define TUKLIB_CPUCORES_SYSCONF 1
#define TUKLIB_FAST_UNALIGNED_ACCESS 1
#define TUKLIB_PHYSMEM_SYSCONF 1
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
#define VERSION "5.4.0"
'''

@ -163,7 +163,7 @@ struct IConsoleWindow : Window
const int right = this->width - WidgetDimensions::scaled.frametext.right;
GfxFillRect(0, 0, this->width - 1, this->height - 1, PC_BLACK);
int ypos = this->height - this->line_height;
int ypos = this->height - this->line_height - WidgetDimensions::scaled.hsep_normal;
for (size_t line_index = IConsoleWindow::scroll; line_index < _iconsole_buffer.size(); line_index++) {
const IConsoleLine &print = _iconsole_buffer[line_index];
SetDParamStr(0, print.buffer);

@ -116,7 +116,7 @@ void RandomBytesWithFallback(std::span<uint8_t> buf)
#if defined(_WIN32)
auto res = BCryptGenRandom(nullptr, static_cast<PUCHAR>(buf.data()), static_cast<ULONG>(buf.size()), BCRYPT_USE_SYSTEM_PREFERRED_RNG);
if (res >= 0) return;
#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__)
#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
arc4random_buf(buf.data(), buf.size());
return;
#elif defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 25)))

@ -125,7 +125,7 @@ static constexpr NWidgetPart _nested_group_widgets[] = {
* @param parent Current tree parent (set by self with recursion).
* @param indent Current tree indentation level (set by self with recursion).
*/
static void GuiGroupListAddChildren(GUIGroupList &dst, const GUIGroupList &src, bool fold, GroupID parent, int indent)
static void GuiGroupListAddChildren(GUIGroupList &dst, const GUIGroupList &src, bool fold, GroupID parent = INVALID_GROUP, uint8_t indent = 0)
{
for (const auto &item : src) {
if (item.group->parent != parent) continue;
@ -141,6 +141,16 @@ static void GuiGroupListAddChildren(GUIGroupList &dst, const GUIGroupList &src,
GuiGroupListAddChildren(dst, src, fold, item.group->index, indent + 1);
}
}
if (indent > 0 || dst.empty()) return;
/* Hierarchy is complete, traverse in reverse to find where indentation levels continue. */
uint16_t level_mask = 0;
for (auto it = std::rbegin(dst); std::next(it) != std::rend(dst); ++it) {
auto next_it = std::next(it);
SB(level_mask, it->indent, 1, it->indent <= next_it->indent);
next_it->level_mask = level_mask;
}
}
/**
@ -325,7 +335,7 @@ private:
* @param protection Whether autoreplace protection is set.
* @param has_children Whether the group has children and should have a fold / unfold button.
*/
void DrawGroupInfo(int y, int left, int right, GroupID g_id, int indent = 0, bool protection = false, bool has_children = false) const
void DrawGroupInfo(int y, int left, int right, GroupID g_id, uint16_t level_mask = 0, uint8_t indent = 0, bool protection = false, bool has_children = false) const
{
/* Highlight the group if a vehicle is dragged over it */
if (g_id == this->group_over) {
@ -339,10 +349,27 @@ private:
const GroupStatistics &stats = GroupStatistics::Get(this->vli.company, g_id, this->vli.vtype);
bool rtl = _current_text_dir == TD_RTL;
const int offset = (rtl ? -(int)this->column_size[VGC_FOLD].width : (int)this->column_size[VGC_FOLD].width) / 2;
const int level_width = rtl ? -WidgetDimensions::scaled.hsep_indent : WidgetDimensions::scaled.hsep_indent;
const int linecolour = GetColourGradient(COLOUR_ORANGE, SHADE_NORMAL);
if (indent > 0) {
/* Draw tree continuation lines. */
int tx = (rtl ? right - WidgetDimensions::scaled.framerect.right : left + WidgetDimensions::scaled.framerect.left) + offset;
for (uint lvl = 1; lvl <= indent; ++lvl) {
if (HasBit(level_mask, lvl)) GfxDrawLine(tx, y, tx, y + this->tiny_step_height - 1, linecolour, WidgetDimensions::scaled.fullbevel.top);
if (lvl < indent) tx += level_width;
}
/* Draw our node in the tree. */
int ycentre = y + this->tiny_step_height / 2 - 1;
if (!HasBit(level_mask, indent)) GfxDrawLine(tx, y, tx, ycentre, linecolour, WidgetDimensions::scaled.fullbevel.top);
GfxDrawLine(tx, ycentre, tx + offset - (rtl ? -1 : 1), ycentre, linecolour, WidgetDimensions::scaled.fullbevel.top);
}
/* draw fold / unfold button */
int x = rtl ? right - WidgetDimensions::scaled.framerect.right - this->column_size[VGC_FOLD].width + 1 : left + WidgetDimensions::scaled.framerect.left;
if (has_children) {
DrawSprite(Group::Get(g_id)->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED, PAL_NONE, rtl ? x - indent : x + indent, y + (this->tiny_step_height - this->column_size[VGC_FOLD].height) / 2);
DrawSprite(Group::Get(g_id)->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED, PAL_NONE, x + indent * level_width, y + (this->tiny_step_height - this->column_size[VGC_FOLD].height) / 2);
}
/* draw group name */
@ -356,7 +383,7 @@ private:
str = STR_GROUP_NAME;
}
x = rtl ? x - WidgetDimensions::scaled.hsep_normal - this->column_size[VGC_NAME].width : x + WidgetDimensions::scaled.hsep_normal + this->column_size[VGC_FOLD].width;
DrawString(x + (rtl ? 0 : indent), x + this->column_size[VGC_NAME].width - 1 - (rtl ? indent : 0), y + (this->tiny_step_height - this->column_size[VGC_NAME].height) / 2, str, colour);
DrawString(x + (rtl ? 0 : indent * WidgetDimensions::scaled.hsep_indent), x + this->column_size[VGC_NAME].width - 1 - (rtl ? indent * WidgetDimensions::scaled.hsep_indent : 0), y + (this->tiny_step_height - this->column_size[VGC_NAME].height) / 2, str, colour);
/* draw autoreplace protection */
x = rtl ? x - WidgetDimensions::scaled.hsep_wide - this->column_size[VGC_PROTECT].width : x + WidgetDimensions::scaled.hsep_wide + this->column_size[VGC_NAME].width;
@ -706,7 +733,7 @@ public:
assert(g->owner == this->owner);
DrawGroupInfo(y1, r.left, r.right, g->index, it->indent * WidgetDimensions::scaled.hsep_indent, HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), g->folded || (std::next(it) != std::end(this->groups) && std::next(it)->indent > it->indent));
DrawGroupInfo(y1, r.left, r.right, g->index, it->level_mask, it->indent, HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), g->folded || (std::next(it) != std::end(this->groups) && std::next(it)->indent > it->indent));
y1 += this->tiny_step_height;
}

@ -21,9 +21,10 @@ void DeleteGroupHighlightOfVehicle(const Vehicle *v);
struct GUIGroupListItem {
const Group *group;
int8_t indent; ///< Display indentation level.
uint8_t indent; ///< Display indentation level.
uint16_t level_mask; ///< Bitmask of indentation continuation.
constexpr GUIGroupListItem(const Group *group, int8_t indent) : group(group), indent(indent) {}
constexpr GUIGroupListItem(const Group *group, int8_t indent) : group(group), indent(indent), level_mask(0) {}
};
using GUIGroupList = GUIList<GUIGroupListItem>;

@ -4624,6 +4624,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Verander
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Geen voertuie is op die oomblik beskikbaar nie
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Begin na {DATE_SHORT} of gebruik 'n NewGRF wat voertuie vroeër beskikbaar stel
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kan nie trein forseer om sein te vermy op gevaar...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kan nie rigting van trein verander nie...

@ -4418,6 +4418,7 @@ STR_ERROR_CAN_T_CLONE_VEHICLE_LIST :{WHITE}... لي
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}لن تتوافر اى وسائل نقل على اﻹطلاق
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}لا تتوافر اى آليه نقل بعد
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}لا يمكن السماح للقطار بالعبور من الاشارة في وضع الخطر
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}لا يمكن عكس اتجاة القطار...

@ -4369,6 +4369,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ez da ib
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Aldatu zure NewGRF konfigurazioa
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ez dago ibilgailu erabilgarririk oraindik
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Ezin da trena seinalea pasatzera behartu, istripu arriskua...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ezin da trenaren norabidea aldatu...

@ -5631,6 +5631,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Зьмя
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Няма даступных транспартных сродкаў
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Пачніце гульню пасьля {DATE_SHORT} або падключыце NewGRF з транспартам адпаведных часоў.
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Немагчыма іґнараваць сыґнал. Небясьпечна...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Не атрымалася завярнуць цягнік...

@ -5282,11 +5282,16 @@ STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... veí
STR_ERROR_CAN_T_CLONE_VEHICLE_LIST :{WHITE}... nem todos os veículos são idênticos
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Não haverá veículos disponíveis
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Nenhum veículo estará disponível
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Modifique a sua configuração de NewGRF
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Não existem veículos disponíveis ainda
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Inicie um novo jogo depois de {DATE_SHORT} ou utilize um NewGRF que forneça veículos iniciais
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}Nenhum tipo de estrada urbana está disponível
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Modifique a sua configuração de NewGRF
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}Não existem tipos de estrada urbana disponíveis ainda
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}Inicie um novo jogo depois de {DATE_SHORT} ou utilize um NewGRF que forneça estradas urbanas iniciais
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Não é possível fazer o trem passar o sinal em perigo...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Não é possível inverter a direção do trem...

@ -4654,6 +4654,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Пром
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Няма налични превозни средства все още
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Започни нова игра след {DATE_SHORT} или използвай NewGRF , който показва ранни превозни средства
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Влака не може да пропусне сигнала при опасност...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Не може да обърне посоката на влак...

@ -5287,6 +5287,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Canvia l
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Encara no hi ha vehicles disponibles
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Inicieu una partida nova després de {DATE_SHORT} o useu un NewGRF que proporcioni vehicles primerencs.
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}No pots fer que un tren passi d'una senyal amb perill...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}No es pot invertir la direcció del tren...

@ -1709,6 +1709,7 @@ STR_ERROR_OBJECT_IN_THE_WAY :{WHITE}Ҫул
# Specific vehicle errors

@ -4812,6 +4812,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Promijen
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Još nema dostupnih vozila
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Pokreni novu igru nakon {DATE_SHORT} ili upotrijebi NewGRF koji daje vrlo rana vozila
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nije moguće natjerati vlak da ignorira signale dok traje opasnost...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Nije moguće promijeniti smjer vlaka...

@ -5376,6 +5376,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zmeň na
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Zatím nejsou dostupná žádná vozidla
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Začít hru po {DATE_SHORT} nebo použít NewGRF, která zajistí dřívější vozidla
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nelze nechat vlak projet semafory v nebezpečí...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Nelze obrátit vlak...

@ -5286,6 +5286,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Skift di
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ingen køretøjer er tilgængelige endnu
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Start et nyt spil efter {DATE_SHORT} eller brug en NewGRF der giver tidlige køretøjer
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kan ikke få toget til at passere signalet...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kan ikke vende retningen af toget...

@ -5286,6 +5286,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Pas je N
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nog geen voertuigen beschikbaar
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE} Start een nieuw spel na {DATE_SHORT} of gebruik een NewGRF dat in vroege voertuigen voorziet
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kan trein niet het sein laten passeren bij gevaar...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kan de richting van de trein niet omdraaien...

@ -5286,6 +5286,11 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change y
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}No vehicles are available yet
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Start a new game after {DATE_SHORT} or use a NewGRF which provides early vehicles
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}No town-buildable road types are available
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change your NewGRF configuration
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}No town-buildable road types are available yet
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}Start a new game after {DATE_SHORT} or use a NewGRF that provides early town-buildable road types
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Can't make train pass signal at danger...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Can't reverse direction of train...

@ -3488,6 +3488,9 @@ STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Road type
STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}NewGRF variable 60+x parameter (hexadecimal)
# Sprite aligner window
STR_SPRITE_ALIGNER_CAPTION_NO_ACTION :{WHITE}Aligning sprite: ({STRING}:{NUM})
STR_SPRITE_ALIGNER_CAPTION_ACTIONA :{WHITE}Aligning sprite: Action 0xA, {COMMA} ({STRING}:{NUM})
STR_SPRITE_ALIGNER_CAPTION_ACTION5 :{WHITE}Aligning sprite: Action 0x5, type {HEX}, {COMMA} ({STRING}:{NUM})
STR_SPRITE_ALIGNER_NEXT_BUTTON :{BLACK}Next sprite
STR_SPRITE_ALIGNER_NEXT_TOOLTIP :{BLACK}Proceed to the next normal sprite, skipping any pseudo/recolor/font sprites and wrapping around from the last sprite to the first
STR_SPRITE_ALIGNER_GOTO_BUTTON :{BLACK}Go to sprite
@ -3496,6 +3499,7 @@ STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Previous
STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Proceed to the previous normal sprite, skipping any pseudo/recolor/font sprites and wrapping around from the first sprite to the last
STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Representation of the currently selected sprite. The alignment is ignored when drawing this sprite
STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Move the sprite around, changing the X and Y offsets. Ctrl+Click to move the sprite eight units at a time
STR_SPRITE_ALIGNER_SPRITE :{STRING}:{NUM}
###length 2
STR_SPRITE_ALIGNER_CENTRE_OFFSET :{BLACK}Offset centered
@ -5282,6 +5286,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change y
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}No vehicles are available yet
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Start a new game after {DATE_SHORT} or use a NewGRF that provides early vehicles
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Can't make train pass signal at danger...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Can't reverse direction of train...
@ -5832,6 +5837,7 @@ STR_JUST_DATE_ISO :{DATE_ISO}
STR_JUST_STRING :{STRING}
STR_JUST_STRING1 :{STRING}
STR_JUST_STRING2 :{STRING}
STR_JUST_STRING4 :{STRING}
STR_JUST_STRING_STRING :{STRING}{STRING}
STR_JUST_RAW_STRING :{STRING}
STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING}

@ -5144,6 +5144,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Ŝanĝu
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Neniuj veturiloj dume haveblas
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Komencu novan ludon post {DATE_SHORT} aŭ uzu NewGRF-on kiu havebligas frutempajn veturilojn
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Ne povas igi vagonaron transiri signalon je danĝero...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ne povas inversigi direkton de vagonaro...

@ -5334,6 +5334,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Muuda Ne
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Sõidukeid ei ole veel saadaval
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Alusta mängu pärast {DATE_SHORT} või kasuta NewGRF-i, milles on varasemaid sõidukeid
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Rongi ei saa ohu korral sundida signaale eirama...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ei saa rongi ümber pöörata.

@ -4024,6 +4024,7 @@ STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... akfa
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kann ikki fáa tok at fara framvið jarnbreytatekin tá vandi er...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kann ikki venda toki vi...

@ -1311,7 +1311,7 @@ STR_CONFIG_SETTING_RECESSIONS :Lamat: {STRING}
STR_CONFIG_SETTING_RECESSIONS_HELPTEXT :Mikäli käytössä, taloudellinen lama voi ilmaantua ajoittain. Laman aikana kaikki tuotanto on huomattavasti alhaisempaa (palautuu normaalille tasolle laman päätyttyä)
STR_CONFIG_SETTING_TRAIN_REVERSING :Estä junien kääntyminen asemilla: {STRING}
STR_CONFIG_SETTING_TRAIN_REVERSING_HELPTEXT :Mikäli käytössä, junat eivät käänny läpiajettavilla asemilla vaikka kääntymisen jälkeen saatavilla olisi lyhempi reitti
STR_CONFIG_SETTING_TRAIN_REVERSING_HELPTEXT :Mikäli käytössä, junat eivät käänny läpiajettavilla asemilla vaikka kääntymisen jälkeen tarjolla olisi lyhempi reitti
STR_CONFIG_SETTING_DISASTERS :Onnettomuudet: {STRING}
STR_CONFIG_SETTING_DISASTERS_HELPTEXT :Ottaa käyttöön onnettomuudet jotka saattavat ajoittain estää tai tuhota liikennettä tai infrastruktuuria
@ -5281,10 +5281,15 @@ STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... kulk
STR_ERROR_CAN_T_CLONE_VEHICLE_LIST :{WHITE}… kaikki kulkuneuvot eivät ole identtisiä
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Yhtään kulkuneuvoa ei ole saatavilla
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Yhtään kulkuneuvoa ei ole käytettävissä
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Muuta NewGRF-asetuksiasi
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Kulkuneuvoja ei ole vielä saatavilla
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Aloita peli {DATE_SHORT} jälkeen tai käytä NewGRF:ää joka tarjoaa aikaisempia kulkuneuvoja
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Aloita uusi peli {DATE_SHORT} jälkeen tai käytä NewGRF:ää, joka tarjoaa varhaisia kulkuneuvoja
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}Yhtään kunnan rakennettavissa olevaa tietyyppiä ei ole käytettävissä
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Muuta NewGRF-asetuksia
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}Kunnan rakennettavissa olevia tietyyppejä ei ole vielä saatavilla
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}Aloita uusi peli {DATE_SHORT} jälkeen tai käytä NewGRF:ää, joka tarjoaa varhaisia kunnan rakennettavissa olevia tietyyppejä
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Junaa ei voi pakottaa jatkamaan punaisen opastimen ohi...

@ -5287,6 +5287,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Modifier
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Il n'y a pas encore de véhicules disponibles
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Commencer un nouvelle partie après {DATE_SHORT} ou utiliser un NewGRF qui propose des véhicules plus tôt
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Impossible de forcer le train à avancer sous le danger...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Impossible de faire faire demi-tour...

@ -4205,6 +4205,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Feroarje
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Der binne noch gjin fiertugen beskikber
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Begjin in nij spul nei {DATE_SHORT} of brûk in NewGRF dy't earder fiertugen beskikber stelt
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kin trein gjin sein foarby ride litte at dizze gefaar oanjout...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kin rydrjochting fan de trein net oanpasse

@ -4761,6 +4761,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Atharrai
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Chan eil carbad ri fhaighinn fhathast
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Tòisich geama ùr às dèidh {DATE_SHORT} no chleachd NewGRF a bheir carbadan tràtha dhut
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Chan urrainn dhut toirt air trèanaichean dol seachad air comharra fo chunnart...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Chan urrainn dhan trèana tilleadh...

@ -5279,6 +5279,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Cambia a
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Aínda non hai vehículos dispoñíbeis
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Comezar unha partida nova a partires de {DATE_SHORT} ou empregar un NewGRF que proporcione vehículos antigos
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Non se pode facer que o tren rebase un sinal en perigo...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}No se pode cambia-lo sentido do tren...

@ -5281,6 +5281,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Bitte di
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Noch keine Fahrzeuge verfügbar
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Ein neues Spiel nach {DATE_SHORT} beginnen oder ein NewGRF-Fahrzeugset mit früher verfügbaren Fahrzeugen verwenden
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Der Zug kann das Signal nicht gefahrlos passieren ...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Die Zugbewegung kann nicht umgekehrt werden ...

@ -5386,6 +5386,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Αλλά
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Κανένα όχημα δεν είναι διαθέσιμο ακόμη
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Ξεκινήστε ένα νέο παιχνίδι αργότερα από {DATE_SHORT} η χρησιμοποιήστε ένα NewGRF το οποίο προσφέρει νωρίτερα οχήματα
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Δεν μπορεί το τρένο να περάσει σήμα με κίνδυνο...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Δεν αντιστρέφεται η κατεύθυνση του τρένου...

@ -4687,6 +4687,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}שנה
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}כלי תחבורה עדיין לא זמינים
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}התחל משחק חדש אחרי {DATE_SHORT} או השתמש ב-NewGRF המכיל כלי תחבורה קדומים
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}לא ניתן להכריח את הרכבת לעבור ברמזור בעת סכנה...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}לא ניתן להפוך את כיוון הנסיעה של הרכבת...

@ -1574,6 +1574,7 @@ STR_ERROR_CAN_T_SELL_TRAIN :{WHITE}रे
# Specific vehicle errors
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}ट्रेन की दिशा उलट नहीं सकते...

@ -5341,6 +5341,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Változt
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Még nincsenek elérhető járművek
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Indíts új játékot {DATE_SHORT} után, vagy használj olyan NewGRF-et, ami tartalmaz megfelelően korai járműveket!
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nem haladhatja meg a vonat a megállj jelzést...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Nem fordíthatod meg a vonatot...

@ -4255,6 +4255,7 @@ STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... öku
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Engin farartæki verða í boði
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Breyta NewGRF stillingunum þínum
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Get ekki látið lest fara framhjá hættumerki...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Get ekki snúið lest við...

@ -1600,6 +1600,7 @@ STR_ERROR_TOO_MANY_VEHICLES_IN_GAME :{WHITE}Tro mult
# Specific vehicle errors

@ -5161,6 +5161,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Tukarkan
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Belum ada kendaraan yang tersedia saat ini
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Mulai permainan baru setelah {DATE_SHORT} atau gunakan NewGRF yang menyediakan kendaraan awal
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Tidak dapat memaksa kereta melanggar sinyal pada saat bahaya...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Tidak dapat memutar balik arah kereta...

@ -4865,6 +4865,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Athraigh
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Níl aon fheithicil ar fáil fós
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Tosaigh cluiche nua ó {DATE_SHORT} ar aghaidh nó úsáid NewGRF lena gcuirtear feithiclí luath ar fáil
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Ní féidir iallach a chur ar thraein dul thar comhartha agus contúirt ann...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ní féidir treo na traenach a aisiompú...

@ -5319,6 +5319,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Cambiare
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Non sono ancora disponibili veicoli
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Iniziare una nuova partita dopo il {DATE_SHORT} o utilizzare un NewGRF che fornisca veicoli a partire da date antecedenti
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Impossibile far passare al treno un segnale di pericolo...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Impossibile invertire la direzione del treno...

@ -4988,6 +4988,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}NewGRF
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}利用可能な輸送機器がありません
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}{DATE_SHORT}年以降に開始するか、これより早い時期に輸送機器が開発されるNewGRFを利用して下さい
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}赤信号を無視させることができません
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}列車を反転できません

@ -5283,6 +5283,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}NewGRF
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}사용할 수 있는 차량이 하나도 없습니다
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}{DATE_SHORT}년 이후에 새로운 게임을 시작하거나 차량이 더 빨리 개발되는 NewGRF을 사용하십시오.
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}너무 위험해서 신호를 무시할 수 없습니다...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}열차를 회차시킬 수 없습니다...

@ -4752,6 +4752,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Muta con
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nulla vehicula adhuc parabilia sunt
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Incipe ludum post {DATE_SHORT} sive eligere idoneum NewGRF quod vehicula antiqua parat
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Non licet tramen impellere post signale...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Non licet tramini cursum reflectere...

@ -2578,6 +2578,7 @@ STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE} Jūsu s
STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE} Jūsu servera nosaukums nav iestatīts. Nosaukumu var iestatīt vairākspēlētāju loga augšdaļā
STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}Klienta pārskats neatbilst servera pārskatam
STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Nepareiza parole
STR_NETWORK_ERROR_NOT_ON_ALLOW_LIST :{WHITE}Jūs neesat atļauto klientu sarakstā
STR_NETWORK_ERROR_SERVER_FULL :{WHITE}Serveris ir pilns
STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Šajā serverī jums ir aizliegums
STR_NETWORK_ERROR_KICKED :{WHITE}Jūs esat izmests no šīs spēles
@ -5295,6 +5296,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Mainiet
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Transportlīdzekļi vēl nav pieejami
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Sākt jaunu spēli pēc {DATE_SHORT} vai izmantot NewGRF, kas nodrošina agrīnus transporta līdzekļus
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Vilciens nevar šķērsot signālu briesmās...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Vilcienu nevar apgriezt...

@ -5207,6 +5207,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Pakeiski
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Kol kas negalima įsigyti jokių transporto priemonių
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Pradėkite žaidimą vėliau, nei {DATE_SHORT}, arba įdiekite plėtinių, kurie leistų įsigyti transporto priemonių šiame ankstyvame laikotarpyje
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Neįmanoma priversti traukinio važiuoti nesaugiai...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Traukinio vaziavimo krypties pakeisti negalima...

@ -5277,6 +5277,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Änner d
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nach keng Gefierer verfügbar
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}En neit Spill no {DATE_SHORT} ufenken oder benotz en NewGRF den al Gefierer erlaabt
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kann den Zuch net bei Gefor durch d'Signal schécken...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kann d'Richtung vum Zuch net änneren...

@ -2117,6 +2117,7 @@ STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... во
# Specific vehicle errors

@ -4161,6 +4161,7 @@ STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... kend
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Mulakan permainan baru selepas {DATE_SHORT} atau gunakan NewGRF yang digunakan kenderaan terdahulu
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Keretapi tidak boleh melanggar isyarat kerana terdapat kemungkinan bahaya...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Keretapi tidak boleh ditukar arah...

@ -1468,6 +1468,7 @@ STR_ERROR_TOO_MANY_VEHICLES_IN_GAME :{WHITE}Hemm wis
# Specific vehicle errors
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ma tistax tbiddel id-direzzjoni tal-ferrovija...

@ -1867,6 +1867,7 @@ STR_ERROR_BRIDGE_THROUGH_MAP_BORDER :{WHITE}पू
# Specific vehicle errors

@ -5288,6 +5288,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Endre di
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ingen kjøretøyer er tilgjengelig ennå
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Starte et nytt spill etter {DATE_SHORT}, eller bruke en NewGRF som inneholder tidlige kjøretøy
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kan ikke tvinge tog til å passere signal ved fare...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kan ikke reversere toget...

@ -4396,6 +4396,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Byt NewG
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Det finst ikkje nokon køyretøy enno
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Start spelet etter {DATE_SHORT} eller bruk ein GRF som har køyretøy frå tidlegare tider
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kan ikkje tvinge tog til å passere signal ved fare...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kan ikkje snu toget...

@ -3748,6 +3748,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}بطور
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}تنظیمات مربوط به NewGRF را تغییر دهید
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}هنوز خودرویی در دسترس نیست
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}در هنگام خطر نمی توان علامت عبور قطار را داد
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}جهت قطار را نمی شود تغییر داد...

@ -5672,6 +5672,11 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zmień k
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Obecnie żaden pojazd nie jest dostępny
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Zacznij grę po {DATE_SHORT} albo użyj zestawu NewGRF, który zawiera wczesne pojazdy
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}Brak dostępnych typów dróg miejskich
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zmień konfigurację NewGRF
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}Brak jeszcze dostępnych typów dróg miejskich
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}Rozpocznij nową grę po {DATE_SHORT} roku lub użyj NewGRF, który umożliwia wczesne budowanie dróg miejskich
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nie można przepuścić pociągu za sygnał, niebezpieczeństwo...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Nie można odwrócić kierunku jazdy pociągu...

@ -5287,6 +5287,11 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Mudar a
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nenhum veículo ainda disponível
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Começar um novo jogo depois de {DATE_SHORT} ou utilizar um NewGRF que forneça veículos iniciais
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}Não está disponível nenhum tipo de estrada edificável para localidades
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Mudar a sua configuração NewGRF
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}Ainda não estão disponíveis tipos de estradas edificáveis para localidades
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}Começar um novo jogo depois de {DATE_SHORT} ou usar um NewGRF que forneça antecipadamente tipos de estradas edificáveis em localidades
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Não é possível fazer o comboio passar o sinal com perigo...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Não é possível inverter a direcção do comboio...

@ -5273,6 +5273,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Schimbă
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Niciun vehicul nu este disponibil încă
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Începe un joc nou după {DATE_SHORT} sau utilizează un NewGRF care oferă vehicule în avans
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nu se poate permite trenului să treacă în caz de pericol...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Nu se poate schimba sensul de mers al trenului...

@ -5473,6 +5473,11 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Изме
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Нет доступных транспортных средств
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Начните игру не ранее {DATE_SHORT} либо подключите NewGRF, добавляющий транспортные средства, использовавшиеся в это время.
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}Отсутствуют типы дорог, которые могла бы прокладывать городская администрация
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Измените конфигурацию установленных модулей NewGRF
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}Пока что отсутствуют типы дорог, которые могла бы прокладывать городская администрация
STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}Установите дату начала игры не ранее {DATE_SHORT} или установите модуль NewGRF, добавляющий типы дорог, которые будут доступны администрациям городов на выбранную вами дату
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Невозможно игнорировать светофор. Опасно...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Невозможно развернуть поезд...

@ -5380,6 +5380,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Promeni
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nijedno vozilo još uvek nije dostupno
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Pokreni novu igru koja počinje posle {DATE_SHORT} ili koristi NewGRF koji omogućava ranija vozila
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nemoguć je prolaz voza na signal opasnosti...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}... vozilo je uništeno

@ -5283,6 +5283,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}请改
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}暂时沒有可用的载具
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}在{DATE_SHORT}后开始新游戏或使用一款能提供早期载具的NewGRF
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}不能让列车冒险通过信号...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}不能命令列车调头...

@ -5348,6 +5348,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zmena va
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Zatiaľ nie sú dostupné žiadne vozidlá
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Začnite novú hru po {DATE_SHORT} alebo použite NewGRF, ktoré zabezpečí vozidlá v skoršom čase
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nemožno nechať vlak prejsť návestidlo ak hrozí nebezpečenstvo...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Nemožno otočiť vlak naopak...

@ -4645,6 +4645,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zamenjaj
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ni še vozil na razpolago.
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Začni novo igro po {DATE_SHORT} ali uporabi NewGRF, ki vsebuje zgodnja vozila
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Ni mogoče, da vlak v nevarnosti pelje mimo signalov...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ni mogoče spremeniti smeri vlaka...

@ -5287,6 +5287,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Es neces
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}En esta fecha no hay vehículos disponibles
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Comienza una nueva partida después de {DATE_SHORT} o usa un NewGRF que provea vehículos más antiguos
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}No se puede pasar la señal en peligro al tren...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}No se puede cambiar la dirección...

@ -5157,6 +5157,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Se debe
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Todavía no hay vehículos disponibles
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Se debe empezar una nueva partida después de {DATE_SHORT} o usar un NewGRF que proporcione vehículos más antiguos
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}El tren no puede rebasar la señal si está en peligro...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}No se puede cambiar la dirección del tren...

@ -5286,6 +5286,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Ändra d
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Inga fordon är tillgängliga än
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Starta ett nytt spel efter {DATE_SHORT} eller använd en NewGRF som erbjuder tidiga fordon
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kan inte tillåta tåg att passera signal under fara...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kan inte byta tågets riktning...

@ -4871,6 +4871,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}தங
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}தற்போது எந்த வாகனங்களும் கிடையாது
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}{DATE_SHORT} இற்கு பிறகு புதிய ஆட்டம் ஒன்றினைத் தொடங்கு அல்லது NewGRF ஒன்றினைப் பயன்படுத்தி பிற்கால வாகனங்களைப் பயன்படுத்து
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}இரயில் சிக்னலைத் தாண்டிச் செல்ல முடியாது...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}இரயில் செல்லும் திசையினை திருப்ப முடியாது...

@ -4601,6 +4601,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}เป
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}ยังไม่มียานพาหานะให้เลือก
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}เริ่มเกมหลังจาก {DATE_SHORT} หรือเลือกใช้งาน NewGRF ของยานพาหนะที่จัดเตรียมไว้ก่อนหน้านี้
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}ไม่สามารถสั่งให้รถไฟวิ่งผ่านเสาอาณัติสัญญาณที่แสดงท่า "ห้าม"...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}ไม่สามารถกลับทิศขบวนรถไฟได้...

@ -5102,6 +5102,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}請修
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}未有可用的車輛
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}在{DATE_SHORT}後開始新遊戲或使用提供早期車輛的NewGRF
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}無法讓列車通過險阻號誌...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}無法倒轉列車方向...

@ -5279,6 +5279,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Yeni New
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Henüz hiçbir araç kullanılabilir değil
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}{DATE_SHORT} sonra yeni bir oyun başlat veya erken araç sağlayan NewGRF kullan
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Tehlikedeki tren sinyali geçemez...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Tren çevrilemez...

@ -5424,6 +5424,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Змін
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Жоден вид транспорту ще не став доступним
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Починайте нову гру після {DATE_SHORT} або використовуйте NewGRF, в якому транспорт з’являється раніше
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Неможливо проїхати сигнал - небезпечно...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Неможливо розвернути поїзд...

@ -2880,6 +2880,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}مرمت
# Specific vehicle errors

@ -5280,6 +5280,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Thay đ
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Chưa có phương tiện nào có sẵn
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Bắt đầu một màn chơi mới sau {DATE_SHORT} hoặc sử dụng một NewGRF cung cấp sớm phương tiện
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Không thể để tàu hoả qua tín hiệu đèn khi nguy hiểm...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Không thể đổi hướng đoàn tàu...

@ -5280,6 +5280,7 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Newid ei
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Dim cerbydau ar gael eto
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Dechreuwch gêm newydd wedi {DATE_SHORT} neu defnyddiwch NewGRF sy'n darparu cerbydau cynnar
# Specific vehicle errors
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Does dim modd gwneud i drên basio signal pan fo perygl...
STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Methu gwrthdroi'r trên...

@ -41,16 +41,22 @@
#include "../core/serialisation.hpp"
#include "../3rdparty/monocypher/monocypher.h"
#include "../settings_internal.h"
#ifdef DEBUG_DUMP_COMMANDS
# include "../fileio_func.h"
# include "../command_aux.h"
# include "../3rdparty/nlohmann/json.hpp"
# include <charconv>
#endif
#include <sstream>
#include <iomanip>
#include <tuple>
#ifdef DEBUG_DUMP_COMMANDS
#include "../fileio_func.h"
#include "../command_aux.h"
#include "../3rdparty/nlohmann/json.hpp"
#include <charconv>
/** When running the server till the wait point, run as fast as we can! */
/** Helper variable to make the dedicated server go fast until the (first) join.
* Used to load the desync debug logs, i.e. for reproducing a desync.
* There's basically no need to ever enable this, unless you really know what
* you are doing, i.e. debugging a desync.
* See docs/desync.md for details. */
bool _ddc_fastforward = true;
#endif /* DEBUG_DUMP_COMMANDS */
@ -1238,7 +1244,7 @@ void NetworkGameLoop()
}
while (f != nullptr && !feof(f)) {
if (EconTime::CurDate() == next_date && EconTime::CurDateFract() == next_date_fract) {
if (EconTime::CurDate() == next_date && EconTime::CurDateFract() == next_date_fract && TickSkipCounter() == next_tick_skip_counter) {
if (cp != nullptr) {
NetworkSendCommand(cp->tile, cp->p1, cp->p2, cp->p3, cp->cmd & ~CMD_FLAGS_MASK, nullptr, cp->text.c_str(), cp->company, cp->aux_data.get());
DEBUG(net, 0, "injecting: %s; %02x; %06x; %08x; %08x; " OTTD_PRINTFHEX64PAD " %08x; \"%s\"%s (%s)",
@ -1257,6 +1263,13 @@ void NetworkGameLoop()
}
}
/* Skip all entries in the command-log till we caught up with the current game again. */
if (std::make_tuple(EconTime::CurDate(), EconTime::CurDateFract(), TickSkipCounter()) > std::make_tuple(next_date, next_date_fract, next_tick_skip_counter)) {
DEBUG(net, 0, "Skipping to next command at %s", debug_date_dumper().HexDate(next_date, next_date_fract, next_tick_skip_counter));
cp.reset();
check_sync_state = false;
}
if (cp != nullptr || check_sync_state) break;
static char buff[65536];

@ -12,7 +12,7 @@
/**
* Uncomment the following define to enable command replaying.
* See docs/desync.txt for details.
* See docs/desync.md for details.
*/
// #define DEBUG_DUMP_COMMANDS
// #define DEBUG_FAILED_DUMP_COMMANDS

@ -36,19 +36,6 @@ static const uint32_t FIND_SERVER_EXTENDED_TOKEN = 0x2A49582A;
#define ENABLE_NETWORK_SYNC_EVERY_FRAME
#endif /* RANDOM_DEBUG */
/**
* Helper variable to make the dedicated server go fast until the (first) join.
* Used to load the desync debug logs, i.e. for reproducing a desync.
* There's basically no need to ever enable this, unless you really know what
* you are doing, i.e. debugging a desync.
* See docs/desync.txt for details.
*/
#ifdef DEBUG_DUMP_COMMANDS
extern bool _ddc_fastforward;
#else
#define _ddc_fastforward (false)
#endif /* DEBUG_DUMP_COMMANDS */
typedef class ServerNetworkGameSocketHandler NetworkClientSocket;
/** Status of the clients during joining. */

@ -1115,19 +1115,7 @@ void UpdateStationTileCacheFlags(bool force_update)
_station_tile_cache_hash = checksum.state;
for (TileIndex t = 0; t < MapSize(); t++) {
if (HasStationTileRail(t)) {
StationGfx gfx = GetStationGfx(t);
const StationSpec *statspec = GetStationSpec(t);
bool blocked = statspec != nullptr && HasBit(statspec->blocked, gfx);
/* Default stations do not draw pylons under roofs (gfx >= 4) */
bool pylons = statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4;
bool wires = statspec == nullptr || !HasBit(statspec->wires, gfx);
SetStationTileBlocked(t, blocked);
SetStationTileHavePylons(t, pylons);
SetStationTileHaveWires(t, wires);
}
if (HasStationTileRail(t)) SetRailStationTileFlags(t, GetStationSpec(t));
}
}
}

@ -21,12 +21,10 @@
* Finds the best path for given ship using YAPF.
* @param v the ship that needs to find a path
* @param tile the tile to find the path from (should be next tile the ship is about to enter)
* @param enterdir diagonal direction which the ship will enter this new tile from
* @param tracks available tracks on the new tile (to choose from)
* @param path_found [out] Whether a path has been found (true) or has been guessed (false)
* @return the best trackdir for next turn or INVALID_TRACK if the path could not be found
*/
Track YapfShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, ShipPathCache &path_cache);
Track YapfShipChooseTrack(const Ship *v, TileIndex tile, bool &path_found, ShipPathCache &path_cache);
/**
* Returns true if it is better to reverse the ship before leaving depot using YAPF.

@ -172,6 +172,14 @@ public:
return 'w';
}
/** Returns a random trackdir out of a set of trackdirs. */
static Trackdir GetRandomTrackdir(TrackdirBits trackdirs)
{
const int strip_amount = RandomRange(CountBits(trackdirs));
for (int s = 0; s < strip_amount; ++s) RemoveFirstTrackdir(&trackdirs);
return FindFirstTrackdir(trackdirs);
}
/** Returns a random tile/trackdir that can be reached from the current tile/trackdir, or tile/INVALID_TRACK if none is available. */
static std::pair<TileIndex, Trackdir> GetRandomFollowUpTileTrackdir(const Ship *v, TileIndex tile, Trackdir dir)
{
@ -180,17 +188,15 @@ public:
TrackdirBits dirs = follower.m_new_td_bits;
const TrackdirBits dirs_without_90_degree = dirs & ~TrackdirCrossesTrackdirs(dir);
if (dirs_without_90_degree != TRACKDIR_BIT_NONE) dirs = dirs_without_90_degree;
const int strip_amount = RandomRange(CountBits(dirs));
for (int s = 0; s < strip_amount; ++s) RemoveFirstTrackdir(&dirs);
return { follower.m_new_tile, FindFirstTrackdir(dirs) };
return { follower.m_new_tile, GetRandomTrackdir(dirs) };
}
return { follower.m_new_tile, INVALID_TRACKDIR };
}
/** Creates a random path, avoids 90 degree turns. */
static Trackdir CreateRandomPath(const Ship *v, TileIndex tile, Trackdir dir, ShipPathCache &path_cache, int path_length)
static Trackdir CreateRandomPath(const Ship *v, ShipPathCache &path_cache, int path_length)
{
std::pair<TileIndex, Trackdir> tile_dir = { tile, dir };
std::pair<TileIndex, Trackdir> tile_dir = { v->tile, v->GetVehicleTrackdir()};
for (int i = 0; i < path_length; ++i) {
tile_dir = GetRandomFollowUpTileTrackdir(v, tile_dir.first, tile_dir.second);
if (tile_dir.second == INVALID_TRACKDIR) break;
@ -204,33 +210,14 @@ public:
return result;
}
static Trackdir ChooseShipTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, ShipPathCache &path_cache)
static Trackdir ChooseShipTrack(const Ship *v, TileIndex tile, TrackdirBits forward_dirs, TrackdirBits reverse_dirs,
bool &path_found, ShipPathCache &path_cache, Trackdir &best_origin_dir)
{
/* Handle special case - when next tile is destination tile. */
if (tile == v->dest_tile) {
/* Convert tracks to trackdirs */
TrackdirBits trackdirs = TrackBitsToTrackdirBits(tracks);
/* Limit to trackdirs reachable from enterdir. */
trackdirs &= DiagdirReachesTrackdirs(enterdir);
/* use vehicle's current direction if that's possible, otherwise use first usable one. */
Trackdir veh_dir = v->GetVehicleTrackdir();
return (HasTrackdir(trackdirs, veh_dir)) ? veh_dir : (Trackdir)FindFirstBit(trackdirs);
}
/* Move back to the old tile/trackdir (where ship is coming from). */
const TileIndex src_tile = TileAddByDiagDir(tile, ReverseDiagDir(enterdir));
const Trackdir trackdir = v->GetVehicleTrackdir();
dbg_assert(IsValidTrackdir(trackdir));
/* Convert origin trackdir to TrackdirBits. */
const TrackdirBits trackdirs = TrackdirToTrackdirBits(trackdir);
const std::vector<WaterRegionPatchDesc> high_level_path = YapfShipFindWaterRegionPath(v, tile, NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1);
if (high_level_path.empty()) {
path_found = false;
/* Make the ship move around aimlessly. This prevents repeated pathfinder calls and clearly indicates that the ship is lost. */
return CreateRandomPath(v, src_tile, trackdir, path_cache, SHIP_LOST_PATH_LENGTH);
return CreateRandomPath(v, path_cache, SHIP_LOST_PATH_LENGTH);
}
/* Try one time without restricting the search area, which generally results in better and more natural looking paths.
@ -240,7 +227,7 @@ public:
Tpf pf(MAX_SHIP_PF_NODES);
/* Set origin and destination nodes */
pf.SetOrigin(src_tile, trackdirs);
pf.SetOrigin(v->tile, forward_dirs | reverse_dirs);
pf.SetDestination(v);
const bool is_intermediate_destination = static_cast<int>(high_level_path.size()) >= NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1;
if (is_intermediate_destination) pf.SetIntermediateDestination(high_level_path.back());
@ -253,14 +240,16 @@ public:
path_found = pf.FindPath(v);
Node *node = pf.GetBestNode();
if (attempt == 0 && !path_found) continue; // Try again with restricted search area.
if (!path_found || node == nullptr) return GetRandomFollowUpTileTrackdir(v, src_tile, trackdir).second;
/* Make the ship move around aimlessly. This prevents repeated pathfinder calls and clearly indicates that the ship is lost. */
if (!path_found) return CreateRandomPath(v, path_cache, SHIP_LOST_PATH_LENGTH);
/* Return only the path within the current water region if an intermediate destination was returned. If not, cache the entire path
* to the final destination tile. The low-level pathfinder might actually prefer a different docking tile in a nearby region. Without
* caching the full path the ship can get stuck in a loop. */
const WaterRegionPatchDesc end_water_patch = GetWaterRegionPatchInfo(node->GetTile());
const WaterRegionPatchDesc start_water_patch = GetWaterRegionPatchInfo(tile);
assert(start_water_patch == high_level_path.front());
assert(GetWaterRegionPatchInfo(tile) == high_level_path.front());
const WaterRegionPatchDesc start_water_patch = high_level_path.front();
while (node->m_parent) {
const WaterRegionPatchDesc node_water_patch = GetWaterRegionPatchInfo(node->GetTile());
@ -276,10 +265,18 @@ public:
}
node = node->m_parent;
}
assert(node->GetTile() == v->tile);
/* Return INVALID_TRACKDIR to trigger a ship reversal if that is the best option. */
best_origin_dir = node->GetTrackdir();
if ((TrackdirToTrackdirBits(best_origin_dir) & forward_dirs) == TRACKDIR_BIT_NONE) {
path_cache.clear();
return INVALID_TRACKDIR;
}
/* A empty path means we are already at the destination. The pathfinder shouldn't have been called at all.
* Return a random reachable trackdir to hopefully nudge the ship out of this strange situation. */
if (path_cache.empty()) return GetRandomFollowUpTileTrackdir(v, src_tile, trackdir).second;
if (path_cache.empty()) return CreateRandomPath(v, path_cache, 1);
/* Take out the last trackdir as the result. */
const Trackdir result = path_cache.front();
@ -298,52 +295,30 @@ public:
* Check whether a ship should reverse to reach its destination.
* Called when leaving depot.
* @param v Ship.
* @param tile Current position.
* @param td1 Forward direction.
* @param td2 Reverse direction.
* @param trackdir [out] the best of all possible reversed trackdirs.
* @return true if the reverse direction is better.
*/
static bool CheckShipReverse(const Ship *v, TileIndex tile, Trackdir td1, Trackdir td2, Trackdir *trackdir)
static bool CheckShipReverse(const Ship *v, Trackdir *trackdir)
{
const std::vector<WaterRegionPatchDesc> high_level_path = YapfShipFindWaterRegionPath(v, tile, NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1);
if (high_level_path.empty()) {
if (trackdir) *trackdir = INVALID_TRACKDIR;
return false;
}
bool path_found = false;
ShipPathCache dummy_cache;
Trackdir best_origin_dir = INVALID_TRACKDIR;
/* Create pathfinder instance. */
Tpf pf(MAX_SHIP_PF_NODES);
/* Set origin and destination nodes. */
if (trackdir == nullptr) {
pf.SetOrigin(tile, TrackdirToTrackdirBits(td1) | TrackdirToTrackdirBits(td2));
/* The normal case, typically called when ships leave a dock. */
const Trackdir reverse_dir = ReverseTrackdir(v->GetVehicleTrackdir());
const TrackdirBits forward_dirs = TrackdirToTrackdirBits(v->GetVehicleTrackdir());
const TrackdirBits reverse_dirs = TrackdirToTrackdirBits(reverse_dir);
(void)ChooseShipTrack(v, v->tile, forward_dirs, reverse_dirs, path_found, dummy_cache, best_origin_dir);
return path_found && best_origin_dir == reverse_dir;
} else {
DiagDirection entry = ReverseDiagDir(VehicleExitDir(v->direction, v->state));
TrackdirBits rtds = DiagdirReachesTrackdirs(entry) & GetTileTrackdirBits(tile, TRANSPORT_WATER, 0, entry);
pf.SetOrigin(tile, rtds);
}
pf.SetDestination(v);
if (high_level_path.size() > 1) pf.SetIntermediateDestination(high_level_path.back());
pf.RestrictSearch(high_level_path);
/* Find best path. */
if (!pf.FindPath(v)) return false;
Node *pNode = pf.GetBestNode();
if (pNode == nullptr) return false;
/* Path was found, walk through the path back to the origin. */
while (pNode->m_parent != nullptr) {
pNode = pNode->m_parent;
}
Trackdir best_trackdir = pNode->GetTrackdir();
if (trackdir != nullptr) {
*trackdir = best_trackdir;
} else {
assert(best_trackdir == td1 || best_trackdir == td2);
/* This gets called when a ship suddenly can't move forward, e.g. due to terraforming. */
const DiagDirection entry = ReverseDiagDir(VehicleExitDir(v->direction, v->state));
const TrackdirBits reverse_dirs = DiagdirReachesTrackdirs(entry) & GetTileTrackdirBits(v->tile, TRANSPORT_WATER, 0, entry);
(void)ChooseShipTrack(v, v->tile, TRACKDIR_BIT_NONE, reverse_dirs, path_found, dummy_cache, best_origin_dir);
*trackdir = path_found && best_origin_dir != INVALID_TRACKDIR ? best_origin_dir : GetRandomTrackdir(reverse_dirs);
return true;
}
return best_trackdir != td1;
}
};
@ -449,16 +424,15 @@ struct CYapfShip : CYapfT<CYapfShip_TypesT<CYapfShip, CFollowTrackWater, CShipNo
};
/** Ship controller helper - path finder invoker. */
Track YapfShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, ShipPathCache &path_cache)
Track YapfShipChooseTrack(const Ship *v, TileIndex tile, bool &path_found, ShipPathCache &path_cache)
{
Trackdir td_ret = CYapfShip::ChooseShipTrack(v, tile, enterdir, tracks, path_found, path_cache);
Trackdir best_origin_dir = INVALID_TRACKDIR;
const TrackdirBits origin_dirs = TrackdirToTrackdirBits(v->GetVehicleTrackdir());
const Trackdir td_ret = CYapfShip::ChooseShipTrack(v, tile, origin_dirs, TRACKDIR_BIT_NONE, path_found, path_cache, best_origin_dir);
return (td_ret != INVALID_TRACKDIR) ? TrackdirToTrack(td_ret) : INVALID_TRACK;
}
bool YapfShipCheckReverse(const Ship *v, Trackdir *trackdir)
{
Trackdir td = v->GetVehicleTrackdir();
Trackdir td_rev = ReverseTrackdir(td);
TileIndex tile = v->tile;
return CYapfShip::CheckShipReverse(v, tile, td, td_rev, trackdir);
return CYapfShip::CheckShipReverse(v, trackdir);
}

@ -587,14 +587,11 @@ static void ShipArrivesAt(const Vehicle *v, Station *st)
*
* @param v Ship to navigate
* @param tile Tile, the ship is about to enter
* @param enterdir Direction of entering
* @param tracks Available track choices on \a tile
* @return Track to choose, or INVALID_TRACK when to reverse.
*/
static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
static Track ChooseShipTrack(Ship *v, TileIndex tile, TrackBits tracks)
{
dbg_assert(IsValidDiagDirection(enterdir));
bool path_found = true;
Track track;
@ -621,7 +618,7 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
switch (_settings_game.pf.pathfinder_for_ships) {
case VPF_NPF: track = NPFShipChooseTrack(v, path_found); break;
case VPF_YAPF: track = YapfShipChooseTrack(v, tile, enterdir, tracks, path_found, v->cached_path); break;
case VPF_YAPF: track = YapfShipChooseTrack(v, tile, path_found, v->cached_path); break;
default: NOT_REACHED();
}
}
@ -1065,7 +1062,7 @@ static void ShipController(Ship *v)
}
/* Choose a direction, and continue if we find one */
Track track = ChooseShipTrack(v, gp.new_tile, diagdir, tracks);
Track track = ChooseShipTrack(v, gp.new_tile, tracks);
if (track == INVALID_TRACK) return ReverseShip(v);
/* Try to avoid collision and keep distance between ships. */

@ -1458,6 +1458,24 @@ static void RestoreTrainReservation(Train *v)
if (IsRailStationTile(v->tile)) SetRailStationPlatformReservation(v->tile, TrackdirToExitdir(ReverseTrackdir(v->GetVehicleTrackdir())), true);
}
/**
* Set rail station tile flags for the given tile.
* @param tile Tile to set flags on.
* @param statspec Statspec of the tile.
*/
void SetRailStationTileFlags(TileIndex tile, const StationSpec *statspec)
{
const StationGfx gfx = GetStationGfx(tile);
bool blocked = statspec != nullptr && HasBit(statspec->blocked, gfx);
/* Default stations do not draw pylons under roofs (gfx >= 4) */
bool pylons = statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4;
bool wires = statspec == nullptr || !HasBit(statspec->wires, gfx);
SetStationTileBlocked(tile, blocked);
SetStationTileHavePylons(tile, pylons);
SetStationTileHaveWires(tile, wires);
}
/**
* Build rail station
* @param tile_org northern most position of station dragging/placement
@ -1659,18 +1677,9 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32_
TriggerStationAnimation(st, tile, SAT_BUILT);
}
/* Should be the same as layout but axis component could be wrong... */
StationGfx gfx = GetStationGfx(tile);
bool blocked = statspec != nullptr && HasBit(statspec->blocked, gfx);
/* Default stations do not draw pylons under roofs (gfx >= 4) */
bool pylons = statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4;
bool wires = statspec == nullptr || !HasBit(statspec->wires, gfx);
SetStationTileBlocked(tile, blocked);
SetStationTileHavePylons(tile, pylons);
SetStationTileHaveWires(tile, wires);
SetRailStationTileFlags(tile, statspec);
if (!blocked) c->infrastructure.rail[rt]++;
if (!IsStationTileBlocked(tile)) c->infrastructure.rail[rt]++;
c->infrastructure.station++;
tile += tile_delta;

@ -33,6 +33,7 @@ void UpdateStationAcceptance(Station *st, bool show_msg);
CargoTypes GetAcceptanceMask(const Station *st);
CargoTypes GetEmptyMask(const Station *st);
void SetRailStationTileFlags(TileIndex tile, const StationSpec *statspec);
const DrawTileSprites *GetStationTileLayout(StationType st, uint8_t gfx);
void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image);

@ -2834,7 +2834,15 @@ void VehicleEnterDepot(Vehicle *v)
/* If we've entered our unbunching depot, record the round trip duration. */
if (v->current_order.GetDepotActionType() & ODATFB_UNBUNCH && v->unbunch_state != nullptr && v->unbunch_state->depot_unbunching_last_departure != INVALID_STATE_TICKS) {
v->unbunch_state->round_trip_time = (_state_ticks - v->unbunch_state->depot_unbunching_last_departure).AsTicks();
Ticks measured_round_trip = (_state_ticks - v->unbunch_state->depot_unbunching_last_departure).AsTicks();
Ticks &rtt = v->unbunch_state->round_trip_time;
if (rtt == 0) {
/* This might be our first round trip. */
rtt = measured_round_trip;
} else {
/* If we have a previous trip, smooth the effects of outlier trip calculations caused by jams or other interference. */
rtt = Clamp(measured_round_trip, (rtt / 2), ClampTo<Ticks>(rtt * 2));
}
}
v->current_order.MakeDummy();
@ -3932,7 +3940,7 @@ void Vehicle::LeaveUnbunchingDepot()
SetWindowDirty(WC_VEHICLE_TIMETABLE, this->index);
/* Find the average travel time of vehicles that we share orders with. */
uint num_vehicles = 0;
int num_vehicles = 0;
Ticks total_travel_time = 0;
Vehicle *u = this->FirstShared();
@ -3945,10 +3953,10 @@ void Vehicle::LeaveUnbunchingDepot()
}
/* Make sure we cannot divide by 0. */
num_vehicles = std::max(num_vehicles, 1u);
num_vehicles = std::max(num_vehicles, 1);
/* Calculate the separation by finding the average travel time, then calculating equal separation (minimum 1 tick) between vehicles. */
Ticks separation = std::max((total_travel_time / num_vehicles / num_vehicles), 1u);
Ticks separation = std::max((total_travel_time / num_vehicles / num_vehicles), 1);
StateTicks next_departure = _state_ticks + separation;
/* Set the departure time of all vehicles that we share orders with. */
@ -3959,6 +3967,7 @@ void Vehicle::LeaveUnbunchingDepot()
if (u->unbunch_state == nullptr) u->unbunch_state.reset(new VehicleUnbunchState());
u->unbunch_state->depot_unbunching_next_departure = next_departure;
SetWindowDirty(WC_VEHICLE_VIEW, u->index);
}
}

@ -4070,6 +4070,8 @@ public:
} else { // no train/RV
str = STR_VEHICLE_STATUS_STOPPED;
}
} else if (v->IsInDepot() && v->IsWaitingForUnbunching()) {
str = STR_VEHICLE_STATUS_WAITING_UNBUNCHING;
} else if (v->type == VEH_TRAIN && HasBit(Train::From(v)->flags, VRF_TRAIN_STUCK) && !v->current_order.IsType(OT_LOADING) && !mouse_over_start_stop) {
str = HasBit(Train::From(v)->flags, VRF_WAITING_RESTRICTION) ? STR_VEHICLE_STATUS_TRAIN_STUCK_WAIT_RESTRICTION : STR_VEHICLE_STATUS_TRAIN_STUCK;
} else if (v->type == VEH_TRAIN && Train::From(v)->reverse_distance >= 1) {
@ -4081,8 +4083,6 @@ public:
}
} else if (v->type == VEH_AIRCRAFT && HasBit(Aircraft::From(v)->flags, VAF_DEST_TOO_FAR) && !v->current_order.IsType(OT_LOADING)) {
str = STR_VEHICLE_STATUS_AIRCRAFT_TOO_FAR;
} else if (v->IsInDepot() && v->IsWaitingForUnbunching()) {
str = STR_VEHICLE_STATUS_WAITING_UNBUNCHING;
} else { // vehicle is in a "normal" state, show current order
switch (v->current_order.GetType()) {
case OT_GOTO_STATION: {

@ -221,7 +221,6 @@ void VideoDriver_Dedicated::MainLoop()
if (!_dedicated_forks) DedicatedHandleKeyInput();
this->DrainCommandQueue();
ChangeGameSpeed(_ddc_fastforward);
this->Tick();
this->SleepTillNextTick();
}

@ -16,6 +16,7 @@
#include "../gfx_func.h"
#include "../settings_type.h"
#include "../zoom_type.h"
#include "../network/network_func.h"
#include <atomic>
#include <chrono>
#include <condition_variable>
@ -317,6 +318,12 @@ protected:
std::chrono::steady_clock::duration GetGameInterval()
{
#ifdef DEBUG_DUMP_COMMANDS
/* When replaying, run as fast as we can. */
extern bool _ddc_fastforward;
if (_ddc_fastforward) return std::chrono::microseconds(0);
#endif /* DEBUG_DUMP_COMMANDS */
/* If we are paused, run on normal speed. */
if (_pause_mode) return std::chrono::milliseconds(MILLISECONDS_PER_TICK);
/* Infinite speed, as quickly as you can. */

@ -320,16 +320,7 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
if (old_specindex != map_spec_index) DeallocateSpecFromStation(wp, old_specindex);
SetCustomStationSpecIndex(tile, map_spec_index);
/* Should be the same as layout but axis component could be wrong... */
StationGfx gfx = GetStationGfx(tile);
bool blocked = spec != nullptr && HasBit(spec->blocked, gfx);
/* Default stations do not draw pylons under roofs (gfx >= 4) */
bool pylons = spec != nullptr ? HasBit(spec->pylons, gfx) : gfx < 4;
bool wires = spec == nullptr || !HasBit(spec->wires, gfx);
SetStationTileBlocked(tile, blocked);
SetStationTileHavePylons(tile, pylons);
SetStationTileHaveWires(tile, wires);
SetRailStationTileFlags(tile, spec);
SetRailStationReservation(tile, reserved);
MarkTileDirtyByTile(tile, VMDF_NOT_MAP_MODE);

Loading…
Cancel
Save