Merge branch 'master' of github.com:wesnoth/wesnoth

This commit is contained in:
Charles Dang 2014-12-20 19:57:49 +11:00
commit b5092c177c
2 changed files with 10 additions and 7 deletions

View file

@ -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()

View file

@ -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;
}
}