diff --git a/doc/man/wesnoth.6 b/doc/man/wesnoth.6 index b438a82ec7b..665299eae04 100644 --- a/doc/man/wesnoth.6 +++ b/doc/man/wesnoth.6 @@ -232,11 +232,9 @@ uses when connecting to a server, ignoring other preferences. Unsafe. .TP .BI --plugin \ script -(experimental) load a +load a .I script -which defines a Wesnoth plugin. Similar to -.BR --script , -but Lua file should return a function which will be run as a coroutine and periodically woken up with updates. +which defines a Wesnoth plugin. Lua file should return a function which will be run as a coroutine and periodically woken up with updates. .TP .BI -P,\ --patch \ base-file \ patch-file applies a DiffWML patch to a WML file; does not preprocess either of the files. @@ -303,11 +301,6 @@ to .I output without initializing a screen. .TP -.BI --script \ file -(experimental) -.I file -containing a Lua script to control the client. -.TP .BI -s[ host ],\ --server[ =host ] connects to the specified host if any, otherwise connect to the first server in preferences. Example: .B --server diff --git a/src/commandline_options.cpp b/src/commandline_options.cpp index 293885b6374..b75a88edc6c 100644 --- a/src/commandline_options.cpp +++ b/src/commandline_options.cpp @@ -128,7 +128,6 @@ commandline_options::commandline_options(const std::vector& args) , screenshot(false) , screenshot_map_file() , screenshot_output_file() - , script_file() , plugin_file() , script_unsafe_mode(false) , strict_validation(false) @@ -196,13 +195,12 @@ commandline_options::commandline_options(const std::vector& args) ("nomusic", "runs the game without music.") ("nosound", "runs the game without sounds and music.") ("password", po::value(), "uses when connecting to a server, ignoring other preferences.") - ("plugin", po::value(), "(experimental) load a script which defines a wesnoth plugin. similar to --script below, but Lua file should return a function which will be run as a coroutine and periodically woken up with updates.") + ("plugin", po::value(), "load a script which defines a wesnoth plugin. Lua file should return a function which will be run as a coroutine and periodically woken up with updates.") ("render-image", po::value()->multitoken(), "takes two arguments: . Like screenshot, but instead of a map, takes a valid Wesnoth 'image path string' with image path functions, and writes it to a .png file." IMPLY_TERMINAL) ("generate-spritesheet", po::value(), "generates a spritesheet from all png images in the given path, recursively (one sheet per directory)") ("report,R", "initializes game directories, prints build information suitable for use in bug reports, and exits." IMPLY_TERMINAL) ("rng-seed", po::value(), "seeds the random number generator with number . Example: --rng-seed 0") ("screenshot", po::value()->multitoken(), "takes two arguments: . Saves a screenshot of to without initializing a screen. Editor must be compiled in for this to work." IMPLY_TERMINAL) - ("script", po::value(), "(experimental) file containing a Lua script to control the client") ("server,s", po::value()->implicit_value(std::string()), "connects to the host if specified or to the first host in your preferences.") ("strict-validation", "makes validation errors fatal") ("translations-over", po::value(), "Specify the standard for determining whether a translation is complete.") @@ -458,8 +456,6 @@ commandline_options::commandline_options(const std::vector& args) screenshot_map_file = vm["screenshot"].as().first; screenshot_output_file = vm["screenshot"].as().second; } - if(vm.count("script")) - script_file = vm["script"].as(); if(vm.count("unsafe-scripts")) script_unsafe_mode = true; if(vm.count("plugin")) diff --git a/src/commandline_options.hpp b/src/commandline_options.hpp index 4cb052301b8..c6eedc06ea1 100644 --- a/src/commandline_options.hpp +++ b/src/commandline_options.hpp @@ -188,9 +188,7 @@ public: utils::optional screenshot_map_file; /** Output file to put screenshot in. Second parameter given after --screenshot. */ utils::optional screenshot_output_file; - /** File to load lua script from. */ - utils::optional script_file; - /** File to load a lua plugin (similar to a script) from. Experimental / may replace script. */ + /** File to load a lua plugin script from. */ utils::optional plugin_file; /** Whether to load the "package" package for the scripting environment. (This allows to load arbitrary lua packages, and gives untrusted lua the same permissions as wesnoth executable) */ bool script_unsafe_mode; diff --git a/src/game_launcher.cpp b/src/game_launcher.cpp index f73ce3f447d..17635e0420c 100644 --- a/src/game_launcher.cpp +++ b/src/game_launcher.cpp @@ -338,27 +338,6 @@ bool game_launcher::init_lua_script() plugins_manager::get()->get_kernel_base()->load_package(); } - // get the application lua kernel, load and execute script file, if script file is present - if(cmdline_opts_.script_file) { - filesystem::scoped_istream sf = filesystem::istream_file(*cmdline_opts_.script_file); - - if(!sf->fail()) { - /* Cancel all "jumps" to editor / campaign / multiplayer */ - jump_to_multiplayer_ = false; - jump_to_editor_ = false; - jump_to_campaign_.jump = false; - - std::string full_script((std::istreambuf_iterator(*sf)), std::istreambuf_iterator()); - - PLAIN_LOG << "\nRunning lua script: " << *cmdline_opts_.script_file; - - plugins_manager::get()->get_kernel_base()->run(full_script.c_str(), *cmdline_opts_.script_file); - } else { - PLAIN_LOG << "Encountered failure when opening script '" << *cmdline_opts_.script_file << '\''; - error = true; - } - } - if(cmdline_opts_.plugin_file) { std::string filename = *cmdline_opts_.plugin_file;