Skip to content

Commit

Permalink
fix: entity actor mover
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed May 31, 2022
1 parent 397e971 commit 046aadd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Code/client/Services/Debug/Views/EntitiesView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
#include <AI/AIProcess.h>
#include <PlayerCharacter.h>
#include <Games/ActorExtension.h>
#include <Forms/TESObjectCELL.h>

#include <Messages/RequestSpawnData.h>

#include <Events/MoveActorEvent.h>

#include <World.h>
#include <imgui.h>
#include <inttypes.h>
Expand Down Expand Up @@ -178,11 +181,9 @@ void DebugService::DisplayLocalComponent(LocalComponent& aLocalComponent, const

if (ImGui::Button("Teleport to me"))
{
m_world.GetRunner().Queue([acFormId]() {
Actor* pActor = Cast<Actor>(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));
});
}

Expand Down

0 comments on commit 046aadd

Please sign in to comment.