Files @ r24498:e9114d9ab04a
Branch filter:

Location: cpp/openttd-patchpack/source/src/script/CMakeLists.txt

Patric Stout
Fix #6468: don't store version of AIs-started-via-console in name

You can do: "startai myai.3", which starts version 3 of "myai".
This is very useful for testing save/load code between different
versions of your AI.

However, when using this syntax, the AI got saved as "myai.3" as
name of the AI, instead of "myai". This caused several problems,
like indicating to the user the AI could not be found, but still
load the AI. But in all cases, the AI never got the chance to
load the saved data, making the whole reason this exists pointless.

By splitting the name and version already in the console command,
the code becomes simpler and AIs started this way now follow the
normal flow after initialization.
add_subdirectory(api)

if(OPTION_TOOLS_ONLY)
    return()
endif()

add_files(
    script_config.cpp
    script_config.hpp
    script_fatalerror.hpp
    script_info.cpp
    script_info.hpp
    script_info_dummy.cpp
    script_instance.cpp
    script_instance.hpp
    script_scanner.cpp
    script_scanner.hpp
    script_storage.hpp
    script_suspend.hpp
    squirrel.cpp
    squirrel.hpp
    squirrel_class.hpp
    squirrel_helper.hpp
    squirrel_helper_type.hpp
    squirrel_std.cpp
    squirrel_std.hpp
)