#include "engine/script.hpp" #include ScriptEngine::ScriptEngine() { lua_.open_libraries(sol::lib::base, sol::lib::table, sol::lib::string, sol::lib::math, sol::lib::os); } bool ScriptEngine::run_file(const std::string& path) { sol::protected_function_result r = lua_.safe_script_file(path, sol::script_pass_on_error); if (!r.valid()) { sol::error err = r; fprintf(stderr, "Lua error (%s): %s\n", path.c_str(), err.what()); return false; } return true; }