aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/ScriptSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system/ScriptSystem.cpp')
-rw-r--r--src/crepe/system/ScriptSystem.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/crepe/system/ScriptSystem.cpp b/src/crepe/system/ScriptSystem.cpp
index 4cce42b..411a9a3 100644
--- a/src/crepe/system/ScriptSystem.cpp
+++ b/src/crepe/system/ScriptSystem.cpp
@@ -36,15 +36,17 @@ void ScriptSystem::update(
script->init();
script->initialized = true;
} catch (const exception & e) {
- Log::logf(Log::Level::WARNING, "Uncaught exception in {} init: {}", behavior_script.name, e.what());
+ Log::logf(Log::Level::WARNING, "Disabled script \"{}\" due to exception in init function: {}", behavior_script.name, e.what());
+ behavior_script.active = false;
}
}
try {
(*script.*update_function)(delta_time);
} catch (const exception & e) {
- // TODO: print if it is fixed/frame update
- Log::logf(Log::Level::WARNING, "Uncaught exception in {}: {}", behavior_script.name, e.what());
+ // TODO: discern between fixed/frame update
+ Log::logf(Log::Level::WARNING, "Disabled script \"{}\" due to exception in update function: {}", behavior_script.name, e.what());
+ behavior_script.active = false;
}
}
}