mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-20 16:15:40 +00:00
fixup error logging associated to lua script, plugin options
This commit is contained in:
parent
274084b916
commit
b8e3f9abf9
@ -445,7 +445,9 @@ bool game_launcher::init_video()
|
||||
|
||||
bool game_launcher::init_lua_script()
|
||||
{
|
||||
std::cerr << "checking lua scripts\n";
|
||||
bool error = false;
|
||||
|
||||
std::cerr << "checking lua scripts... ";
|
||||
|
||||
if (cmdline_opts_.script_unsafe_mode) {
|
||||
plugins_manager::get()->get_kernel_base()->load_package(); //load the "package" package, so that scripts can get what packages they want
|
||||
@ -467,10 +469,9 @@ bool game_launcher::init_lua_script()
|
||||
std::cerr << "\nRunning lua script: " << *cmdline_opts_.script_file << std::endl;
|
||||
|
||||
plugins_manager::get()->get_kernel_base()->run(full_script.c_str());
|
||||
|
||||
return true;
|
||||
} else {
|
||||
std::cerr << "Encountered failure when opening script '" << *cmdline_opts_.script_file << "'\n";
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -523,13 +524,15 @@ bool game_launcher::init_lua_script()
|
||||
return true;
|
||||
} catch (std::exception & e) {
|
||||
gui2::show_error_message(disp().video(), std::string("When loading a plugin, error:\n") + e.what());
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cerr << "no plugin file found\n";
|
||||
|
||||
if (!error) {
|
||||
std::cerr << "ok\n";
|
||||
}
|
||||
|
||||
return false;
|
||||
return !error;
|
||||
}
|
||||
|
||||
bool game_launcher::play_test()
|
||||
|
@ -533,7 +533,7 @@ static void handle_lua_script_args(game_launcher * game, commandline_options & /
|
||||
first_time = false;
|
||||
|
||||
if (!game->init_lua_script()) {
|
||||
std::cerr << "error when loading lua scripts at startup\n";
|
||||
//std::cerr << "error when loading lua scripts at startup\n";
|
||||
//std::cerr << "could not load lua script: " << *cmdline_opts.script_file << std::endl;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user