diff --git a/Code/client/Services/Debug/Views/EntitiesView.cpp b/Code/client/Services/Debug/Views/EntitiesView.cpp index f2ef3f2ce..ef8c8f54b 100644 --- a/Code/client/Services/Debug/Views/EntitiesView.cpp +++ b/Code/client/Services/Debug/Views/EntitiesView.cpp @@ -5,9 +5,12 @@ #include #include #include +#include #include +#include + #include #include #include @@ -178,11 +181,9 @@ void DebugService::DisplayLocalComponent(LocalComponent& aLocalComponent, const if (ImGui::Button("Teleport to me")) { - m_world.GetRunner().Queue([acFormId]() { - Actor* pActor = Cast(TESForm::GetById(acFormId)); - PlayerCharacter* pPlayer = PlayerCharacter::Get(); - if (pActor) - pActor->MoveTo(pPlayer->parentCell, pPlayer->position); + m_world.GetRunner().Queue([this, acFormId]() { + auto* pPlayer = PlayerCharacter::Get(); + m_world.GetRunner().Trigger(MoveActorEvent(acFormId, pPlayer->parentCell->formID, pPlayer->position)); }); }