From bf803e40cc191cc5e2926fbb5d239ef1ea73d312 Mon Sep 17 00:00:00 2001 From: truebrain Date: Thu, 1 Dec 2011 12:03:34 +0000 Subject: [PATCH] (svn r23384) -Remove: no longer allow a binary to be without AI support; the parts some compilers failed at, are integrated in other parts of the code now too --- Doxyfile | 2 +- config.lib | 18 ++----- projects/openttd_vs100.vcxproj | 8 +-- projects/openttd_vs100.vcxproj.in | 8 +-- projects/openttd_vs80.vcproj | 8 +-- projects/openttd_vs80.vcproj.in | 8 +-- projects/openttd_vs90.vcproj | 8 +-- projects/openttd_vs90.vcproj.in | 8 +-- source.list | 2 - src/ai/ai.hpp | 24 --------- src/ai/ai_gui.hpp | 13 ----- src/ai/ai_info.hpp | 3 -- src/company_cmd.cpp | 4 -- src/console_cmds.cpp | 4 -- src/crashlog.cpp | 2 - src/lang/english.txt | 3 -- src/network/network_command.cpp | 4 -- src/network/network_content.cpp | 2 - src/openttd.cpp | 4 -- src/saveload/ai_sl.cpp | 88 ++----------------------------- src/screenshot.cpp | 2 - src/settings.cpp | 6 --- src/settings_gui.cpp | 2 - 23 files changed, 33 insertions(+), 198 deletions(-) diff --git a/Doxyfile b/Doxyfile index fc05faa234..3d6059186f 100644 --- a/Doxyfile +++ b/Doxyfile @@ -195,7 +195,7 @@ EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = -PREDEFINED = ENABLE_NETWORK ENABLE_AI WITH_ZLIB WITH_LZO WITH_LZMA WITH_SDL WITH_PNG WITH_FONTCONFIG WITH_FREETYPE WITH_ICU UNICODE _UNICODE _GNU_SOURCE +PREDEFINED = ENABLE_NETWORK WITH_ZLIB WITH_LZO WITH_LZMA WITH_SDL WITH_PNG WITH_FONTCONFIG WITH_FREETYPE WITH_ICU UNICODE _UNICODE _GNU_SOURCE EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- diff --git a/config.lib b/config.lib index 2c7e0ff780..5507b9c734 100644 --- a/config.lib +++ b/config.lib @@ -54,7 +54,6 @@ set_default() { enable_lto="0" enable_dedicated="0" enable_network="1" - enable_ai="1" enable_static="1" enable_translator="0" enable_unicode="1" @@ -128,7 +127,6 @@ set_default() { enable_lto enable_dedicated enable_network - enable_ai enable_static enable_translator enable_unicode @@ -286,9 +284,6 @@ detect_params() { --enable-network) enable_network="2";; --enable-network=*) enable_network="$optarg";; --disable-network) enable_network="0";; - --enable-ai) enable_ai="2";; - --enable-ai=*) enable_ai="$optarg";; - --disable-ai) enable_ai="0";; --disable-static) enable_static="0";; --enable-static) enable_static="2";; --enable-static=*) enable_static="$optarg";; @@ -743,13 +738,8 @@ check_params() { log 1 "checking network... disabled" fi - if [ "$enable_ai" != "0" ]; then - log 1 "checking ai... found" - SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include" - else - log 1 "checking ai... disabled" - SCRIPT_SRC_DIR="" - fi + log 1 "checking squirrel... found" + SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include" if [ "$enable_translator" != "0" ]; then log 1 "checking translator... debug" @@ -1586,9 +1576,7 @@ make_cflags_and_ldflags() { if [ "$cpu_type" = "64" ] && [ "$enable_universal" = "0" ]; then CFLAGS="$CFLAGS -D_SQ64" fi - if [ "$enable_ai" != "0" ]; then - CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR -DENABLE_AI" - fi + CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR" if [ -n "$png_config" ]; then CFLAGS="$CFLAGS -DWITH_PNG" diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj index e2da3e7c80..8f9e0027c6 100644 --- a/projects/openttd_vs100.vcxproj +++ b/projects/openttd_vs100.vcxproj @@ -102,7 +102,7 @@ Size true ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions) true Sync MultiThreaded @@ -156,7 +156,7 @@ /MP %(AdditionalOptions) Disabled ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -204,7 +204,7 @@ Size true ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions) true Sync MultiThreaded @@ -256,7 +256,7 @@ /MP %(AdditionalOptions) Disabled ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug diff --git a/projects/openttd_vs100.vcxproj.in b/projects/openttd_vs100.vcxproj.in index 6f63b725d0..54b0063ec0 100644 --- a/projects/openttd_vs100.vcxproj.in +++ b/projects/openttd_vs100.vcxproj.in @@ -102,7 +102,7 @@ Size true ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions) true Sync MultiThreaded @@ -156,7 +156,7 @@ /MP %(AdditionalOptions) Disabled ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -204,7 +204,7 @@ Size true ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions) true Sync MultiThreaded @@ -256,7 +256,7 @@ /MP %(AdditionalOptions) Disabled ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index b67deecbc1..c51dcb6bbb 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -52,7 +52,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -156,7 +156,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -257,7 +257,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -362,7 +362,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/projects/openttd_vs80.vcproj.in b/projects/openttd_vs80.vcproj.in index 025076c757..cbdc4f1fc0 100644 --- a/projects/openttd_vs80.vcproj.in +++ b/projects/openttd_vs80.vcproj.in @@ -52,7 +52,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -156,7 +156,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -257,7 +257,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -362,7 +362,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 801ade8620..56ffab53c5 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -53,7 +53,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -155,7 +155,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -255,7 +255,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -359,7 +359,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/projects/openttd_vs90.vcproj.in b/projects/openttd_vs90.vcproj.in index 79ea0bec93..d92d95425a 100644 --- a/projects/openttd_vs90.vcproj.in +++ b/projects/openttd_vs90.vcproj.in @@ -53,7 +53,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -155,7 +155,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -255,7 +255,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -359,7 +359,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/source.list b/source.list index ffdda5d1f1..3239cf55bc 100644 --- a/source.list +++ b/source.list @@ -551,7 +551,6 @@ table/water_land.h 3rdparty/md5/md5.cpp 3rdparty/md5/md5.h -#if AI # Script script/script_config.cpp script/script_config.hpp @@ -738,7 +737,6 @@ script/api/script_vehicle.cpp script/api/script_vehiclelist.cpp script/api/script_waypoint.cpp script/api/script_waypointlist.cpp -#end # Blitters #if DEDICATED diff --git a/src/ai/ai.hpp b/src/ai/ai.hpp index d8647be0c2..f0a5eb67b7 100644 --- a/src/ai/ai.hpp +++ b/src/ai/ai.hpp @@ -12,7 +12,6 @@ #ifndef AI_HPP #define AI_HPP -#ifdef ENABLE_AI #include "../script/api/script_event_types.hpp" #include "../date_type.h" #include "../core/string_compare_type.hpp" @@ -153,27 +152,4 @@ private: static class AIScannerLibrary *scanner_library; ///< ScriptScanner instance that is used to find AI Libraries }; -#else /* ENABLE_AI */ - -#include "../company_type.h" - -#define NewEvent(cid, event) nop() -#define BroadcastNewEvent(...) nop() - -class AI { -public: - static void StartNew(CompanyID company, bool rerandomise_ai = true) {} - static void Stop(CompanyID company) {} - static void Initialize() {} - static void Uninitialize(bool keepConfig) {} - static void KillAll() {} - static void GameLoop() {} - static bool HasAI(const struct ContentInfo *ci, bool md5sum) { return false; } - static bool HasAILibrary(const struct ContentInfo *ci, bool md5sum) { return false; } - static void Rescan() {} - static char *GetConsoleList(char *p, const char *last, bool newest_only = false) { return p; } - static void nop() { } -}; - -#endif /* ENABLE_AI */ #endif /* AI_HPP */ diff --git a/src/ai/ai_gui.hpp b/src/ai/ai_gui.hpp index 3fe822879d..ac8cb4a015 100644 --- a/src/ai/ai_gui.hpp +++ b/src/ai/ai_gui.hpp @@ -14,22 +14,9 @@ #include "../company_type.h" -#ifdef ENABLE_AI void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY); void ShowAIConfigWindow(); void ShowAIDebugWindowIfAIError(); void InitializeAIGui(); -#else -#include "../gui.h" -#include "table/strings.h" - -static inline void ShowAIConfigWindow() -{ - ShowErrorMessage(STR_ERROR_NO_AI, STR_ERROR_NO_AI_SUB, WL_INFO); -} -static inline void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY) {ShowAIConfigWindow();} -static inline void ShowAIDebugWindowIfAIError() {} -static inline void InitializeAIGui() {} -#endif /* ENABLE_AI */ #endif /* AI_GUI_HPP */ diff --git a/src/ai/ai_info.hpp b/src/ai/ai_info.hpp index 924ddd2e0a..c582e70c24 100644 --- a/src/ai/ai_info.hpp +++ b/src/ai/ai_info.hpp @@ -12,8 +12,6 @@ #ifndef AI_INFO_HPP #define AI_INFO_HPP -#ifdef ENABLE_AI - #include "../script/script_info.hpp" #include "../script/script_config.hpp" @@ -84,5 +82,4 @@ private: const char *category; ///< The category this library is in. }; -#endif /* ENABLE_AI */ #endif /* AI_INFO_HPP */ diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 2ebd99d666..692431e6ed 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -572,7 +572,6 @@ void StartupCompanies() _next_competitor_start = 0; } -#ifdef ENABLE_AI /** Start a new competitor company if possible. */ static void MaybeStartNewCompany() { @@ -594,7 +593,6 @@ static void MaybeStartNewCompany() DoCommandP(0, 1 | INVALID_COMPANY << 16, 0, CMD_COMPANY_CTRL); } } -#endif /* ENABLE_AI */ /** Initialize the pool of companies. */ void InitializeCompanies() @@ -693,7 +691,6 @@ void OnTick_Companies() if (c->bankrupt_asked != 0) HandleBankruptcyTakeover(c); } -#ifdef ENABLE_AI if (_next_competitor_start == 0) { _next_competitor_start = AI::GetStartNextTime() * DAY_TICKS; } @@ -701,7 +698,6 @@ void OnTick_Companies() if (AI::CanStartNew() && _game_mode != GM_MENU && --_next_competitor_start == 0) { MaybeStartNewCompany(); } -#endif /* ENABLE_AI */ _cur_company_tick_index = (_cur_company_tick_index + 1) % MAX_COMPANIES; } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 4c6a51ba82..6a6404cbc3 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1069,7 +1069,6 @@ DEF_CONSOLE_CMD(ConRestart) return true; } -#ifdef ENABLE_AI /** * Print a text buffer line by line to the console. Lines are seperated by '\n'. * @param buf The buffer to print. @@ -1255,7 +1254,6 @@ DEF_CONSOLE_CMD(ConRescanAI) return true; } -#endif /* ENABLE_AI */ DEF_CONSOLE_CMD(ConRescanNewGRF) { @@ -1892,14 +1890,12 @@ void IConsoleStdLibRegister() IConsoleAliasRegister("list_patches", "list_settings %+"); IConsoleAliasRegister("developer", "setting developer %+"); -#ifdef ENABLE_AI IConsoleCmdRegister("list_ai_libs", ConListAILibs); IConsoleCmdRegister("list_ai", ConListAI); IConsoleCmdRegister("reload_ai", ConReloadAI); IConsoleCmdRegister("rescan_ai", ConRescanAI); IConsoleCmdRegister("start_ai", ConStartAI); IConsoleCmdRegister("stop_ai", ConStopAI); -#endif /* ENABLE_AI */ /* networking functions */ #ifdef ENABLE_NETWORK diff --git a/src/crashlog.cpp b/src/crashlog.cpp index bda4d674f2..c5719ad47d 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -151,9 +151,7 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const if (c->ai_info == NULL) { buffer += seprintf(buffer, last, " %2i: Human\n", (int)c->index); } else { -#ifdef ENABLE_AI buffer += seprintf(buffer, last, " %2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion()); -#endif /* ENABLE_AI */ } } buffer += seprintf(buffer, last, "\n"); diff --git a/src/lang/english.txt b/src/lang/english.txt index 3e33db7ee0..28699feeb0 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3412,9 +3412,6 @@ STR_AI_DEBUG_CONTINUE :{BLACK}Continue STR_AI_DEBUG_CONTINUE_TOOLTIP :{BLACK}Unpause and continue the AI STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}View debug output of this AI -STR_ERROR_NO_AI :{WHITE}OpenTTD is built without AI support... -STR_ERROR_NO_AI_SUB :{WHITE}... no AIs are available! - STR_ERROR_AI_NO_AI_FOUND :No suitable AI found to load.{}This AI is a dummy AI and won't do anything.{}You can download several AIs via the 'Online Content' system STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}One of the running AIs crashed. Please report this to the AI author with a screenshot of the AI Debug Window STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}AI Debug window is only available for the server diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 0e37eeff42..070e810d86 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -39,11 +39,7 @@ static CommandCallback * const _callback_table[] = { /* 0x0F */ CcPlaySound1E, /* 0x10 */ CcStation, /* 0x11 */ CcTerraform, -#ifdef ENABLE_AI /* 0x12 */ CcAI, -#else - /* 0x12 */ NULL, -#endif /* ENABLE_AI */ /* 0x13 */ CcCloneVehicle, /* 0x14 */ CcGiveMoney, /* 0x15 */ CcCreateGroup, diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index de7087c1e0..98c9f171b3 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -180,10 +180,8 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentType type) this->RequestContentList(CONTENT_TYPE_BASE_SOUNDS); this->RequestContentList(CONTENT_TYPE_SCENARIO); this->RequestContentList(CONTENT_TYPE_HEIGHTMAP); -#ifdef ENABLE_AI this->RequestContentList(CONTENT_TYPE_AI); this->RequestContentList(CONTENT_TYPE_AI_LIBRARY); -#endif /* ENABLE_AI */ this->RequestContentList(CONTENT_TYPE_NEWGRF); return; } diff --git a/src/openttd.cpp b/src/openttd.cpp index a0c16f9107..d20a2c33a8 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -342,27 +342,23 @@ static void LoadIntroGame(bool load_newgrfs = true) void MakeNewgameSettingsLive() { -#ifdef ENABLE_AI for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { if (_settings_game.ai_config[c] != NULL) { delete _settings_game.ai_config[c]; } } -#endif /* ENABLE_AI */ /* Copy newgame settings to active settings. * Also initialise old settings needed for savegame conversion. */ _settings_game = _settings_newgame; _old_vds = _settings_client.company.vehicle; -#ifdef ENABLE_AI for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { _settings_game.ai_config[c] = NULL; if (_settings_newgame.ai_config[c] != NULL) { _settings_game.ai_config[c] = new AIConfig(_settings_newgame.ai_config[c]); } } -#endif /* ENABLE_AI */ } /** Callback structure of statements to be executed after the NewGRF scan. */ diff --git a/src/saveload/ai_sl.cpp b/src/saveload/ai_sl.cpp index cfb90c34c1..31828be249 100644 --- a/src/saveload/ai_sl.cpp +++ b/src/saveload/ai_sl.cpp @@ -15,6 +15,11 @@ #include "saveload.h" #include "../string_func.h" +#include "../ai/ai.hpp" +#include "../ai/ai_config.hpp" +#include "../network/network.h" +#include "../ai/ai_instance.hpp" + static char _ai_saveload_name[64]; static int _ai_saveload_version; static char _ai_saveload_settings[1024]; @@ -28,12 +33,6 @@ static const SaveLoad _ai_company[] = { SLE_END() }; -#ifdef ENABLE_AI -#include "../ai/ai.hpp" -#include "../ai/ai_config.hpp" -#include "../network/network.h" -#include "../ai/ai_instance.hpp" - static void SaveReal_AIPL(int *index_ptr) { CompanyID index = (CompanyID)*index_ptr; @@ -125,80 +124,3 @@ static void Save_AIPL() extern const ChunkHandler _ai_chunk_handlers[] = { { 'AIPL', Save_AIPL, Load_AIPL, NULL, NULL, CH_ARRAY | CH_LAST}, }; -#else - -/** The type of the data that follows in the savegame. */ -enum SQSaveLoadType { - SQSL_INT = 0x00, ///< The following data is an integer. - SQSL_STRING = 0x01, ///< The following data is an string. - SQSL_ARRAY = 0x02, ///< The following data is an array. - SQSL_TABLE = 0x03, ///< The following data is an table. - SQSL_BOOL = 0x04, ///< The following data is a boolean. - SQSL_NULL = 0x05, ///< A null variable. - SQSL_ARRAY_TABLE_END = 0xFF, ///< Marks the end of an array or table, no data follows. -}; - -static byte _ai_sl_byte; - -static const SaveLoad _ai_byte[] = { - SLEG_VAR(_ai_sl_byte, SLE_UINT8), - SLE_END() -}; - -static bool LoadObjects() -{ - SlObject(NULL, _ai_byte); - switch (_ai_sl_byte) { - case SQSL_INT: { - int value; - SlArray(&value, 1, SLE_INT32); - return true; - } - - case SQSL_STRING: { - SlObject(NULL, _ai_byte); - static char buf[256]; - SlArray(buf, _ai_sl_byte, SLE_CHAR); - return true; - } - - case SQSL_ARRAY: - while (LoadObjects()) { } - return true; - - case SQSL_TABLE: - while (LoadObjects()) { LoadObjects(); } - return true; - - case SQSL_BOOL: - SlObject(NULL, _ai_byte); - return true; - - case SQSL_NULL: - return true; - - case SQSL_ARRAY_TABLE_END: - return false; - - default: SlErrorCorrupt("Invalid AI data type"); - } -} - -static void Load_AIPL() -{ - CompanyID index; - while ((index = (CompanyID)SlIterateArray()) != (CompanyID)-1) { - SlObject(NULL, _ai_company); - - if (!Company::IsValidAiID(index)) continue; - SlObject(NULL, _ai_byte); - /* Check if there was anything saved at all. */ - if (_ai_sl_byte == 0) continue; - LoadObjects(); - } -} - -extern const ChunkHandler _ai_chunk_handlers[] = { - { 'AIPL', NULL, Load_AIPL, NULL, NULL, CH_ARRAY | CH_LAST}, -}; -#endif /* ENABLE_AI */ diff --git a/src/screenshot.cpp b/src/screenshot.cpp index 474c321ee6..d5d63d113d 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -327,9 +327,7 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user if (c->ai_info == NULL) { p += seprintf(p, lastof(buf), "%2i: Human\n", (int)c->index); } else { -#ifdef ENABLE_AI p += seprintf(p, lastof(buf), "%2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion()); -#endif /* ENABLE_AI */ } } text[1].key = const_cast("Description"); diff --git a/src/settings.cpp b/src/settings.cpp index ddbf7f583d..4082b8dbd2 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1044,9 +1044,7 @@ static bool DifficultyNoiseChange(int32 i) static bool MaxNoAIsChange(int32 i) { if (GetGameSettings().difficulty.max_no_competitors != 0 && -#ifdef ENABLE_AI AI::GetInfoList()->size() == 0 && -#endif /* ENABLE_AI */ (!_networking || _network_server)) { ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); } @@ -1314,7 +1312,6 @@ static void NewsDisplayLoadConfig(IniFile *ini, const char *grpname) static void AILoadConfig(IniFile *ini, const char *grpname) { -#ifdef ENABLE_AI IniGroup *group = ini->GetGroup(grpname); IniItem *item; @@ -1339,7 +1336,6 @@ static void AILoadConfig(IniFile *ini, const char *grpname) } if (item->value != NULL) config->StringToSettings(item->value); } -#endif /* ENABLE_AI */ } /** @@ -1436,7 +1432,6 @@ static void NewsDisplaySaveConfig(IniFile *ini, const char *grpname) static void AISaveConfig(IniFile *ini, const char *grpname) { -#ifdef ENABLE_AI IniGroup *group = ini->GetGroup(grpname); if (group == NULL) return; @@ -1457,7 +1452,6 @@ static void AISaveConfig(IniFile *ini, const char *grpname) IniItem *item = new IniItem(group, name, strlen(name)); item->SetValue(value); } -#endif /* ENABLE_AI */ } /** diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 019fd34908..47225e2a21 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -738,9 +738,7 @@ public: this->InvalidateData(); if (widget / 3 == 0 && -#ifdef ENABLE_AI AI::GetInfoList()->size() == 0 && -#endif /* ENABLE_AI */ this->opt_mod_temp.difficulty.max_no_competitors != 0) { ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); }