diff options
| -rw-r--r-- | src/script_system.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
| diff --git a/src/script_system.cpp b/src/script_system.cpp index c7c3938..769a872 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp | |||
| @@ -235,6 +235,11 @@ void ScriptSystem::runDebugScript(std::string script) { | |||
| 235 | newScript.runner.reset(new sol::thread(sol::thread::create(engine_.lua_state()))); | 235 | newScript.runner.reset(new sol::thread(sol::thread::create(engine_.lua_state()))); |
| 236 | 236 | ||
| 237 | sol::load_result loaded_script = newScript.runner->state().load(script); | 237 | sol::load_result loaded_script = newScript.runner->state().load(script); |
| 238 | if (!loaded_script.valid()) { | ||
| 239 | std::cout << "Error running debug command: " << script << std::endl; | ||
| 240 | return; | ||
| 241 | } | ||
| 242 | |||
| 238 | newScript.callable.reset(new sol::coroutine(loaded_script)); | 243 | newScript.callable.reset(new sol::coroutine(loaded_script)); |
| 239 | 244 | ||
| 240 | if (!*newScript.callable) { | 245 | if (!*newScript.callable) { |
