From 4c8e15722822d0e5e872f872838a8d71af84e1d4 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 13 Mar 2021 15:30:20 -0500 Subject: Added debug info to Script object --- src/script_system.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/script_system.cpp') diff --git a/src/script_system.cpp b/src/script_system.cpp index b993938..7889148 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp @@ -286,6 +286,9 @@ void ScriptSystem::runScript(std::string mapName, std::string scriptName) { Script newScript; newScript.runner.reset(new sol::thread(sol::thread::create(engine_.lua_state()))); newScript.callable.reset(new sol::coroutine(newScript.runner->state().traverse_get(mapName, scriptName))); +#ifdef TANETANE_DEBUG + newScript.debugInfo = mapName + "." + scriptName; +#endif if (!*newScript.callable) { throw std::runtime_error("Error running script: " + mapName + "." + scriptName); @@ -313,6 +316,7 @@ void ScriptSystem::runDebugScript(std::string script) { } newScript.callable.reset(new sol::coroutine(loaded_script)); + newScript.debugInfo = script; if (!*newScript.callable) { std::cout << "Error running debug command: " << script << std::endl; -- cgit 1.4.1