diff --git a/source/tools/atlas/GameInterface/ActorViewer.cpp b/source/tools/atlas/GameInterface/ActorViewer.cpp index 9c0ca2ad30..eb236164ee 100644 --- a/source/tools/atlas/GameInterface/ActorViewer.cpp +++ b/source/tools/atlas/GameInterface/ActorViewer.cpp @@ -102,6 +102,11 @@ CUnit* ActorViewer::GetUnit() return m.Unit; } +void ActorViewer::UnloadObjects() +{ + m.ObjectManager.UnloadObjects(); +} + void ActorViewer::SetActor(const CStrW& id, const CStrW& animation) { bool needsAnimReload = false; diff --git a/source/tools/atlas/GameInterface/ActorViewer.h b/source/tools/atlas/GameInterface/ActorViewer.h index fcc472cfc4..4f19cf44a9 100644 --- a/source/tools/atlas/GameInterface/ActorViewer.h +++ b/source/tools/atlas/GameInterface/ActorViewer.h @@ -13,6 +13,7 @@ public: ~ActorViewer(); void SetActor(const CStrW& id, const CStrW& animation); + void UnloadObjects(); CUnit* GetUnit(); void SetBackgroundColour(const SColor4ub& colour); void SetWalkEnabled(bool enabled); diff --git a/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp index 3dd548b811..0a454df157 100644 --- a/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp @@ -117,7 +117,7 @@ MESSAGEHANDLER(SetActorViewer) // Should replace this with proper actor hot-loading system, or something. View::GetView_Actor()->GetActorViewer().SetActor(L"", L""); - g_Game->GetView()->GetObjectManager().UnloadObjects(); + View::GetView_Actor()->GetActorViewer().UnloadObjects(); vfs_reload_changed_files(); } View::GetView_Actor()->SetSpeedMultiplier(msg->speed);