From: Mikko Rasa Date: Sun, 4 Dec 2022 20:14:52 +0000 (+0200) Subject: Report which system caused invalid access X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4f2c0342e7d2e60a39cec847ecdf981efcf39b15;p=libs%2Fgame.git Report which system caused invalid access --- diff --git a/source/game/stage.cpp b/source/game/stage.cpp index 43446bd..f8dbd1a 100644 --- a/source/game/stage.cpp +++ b/source/game/stage.cpp @@ -1,4 +1,6 @@ #include "stage.h" +#include +#include #include "accessguard.h" #include "camera.h" #include "root.h" @@ -62,7 +64,14 @@ void Stage::tick(Time::TimeDelta dt) for(const auto &s: systems) { System::Activator act(*s); - s->tick(dt); + try + { + s->tick(dt); + } + catch(const invalid_access &exc) + { + throw invalid_access(format("%s by %s", exc.what(), Debug::demangle(typeid(*s).name()))); + } } }