Skip to content

Commit

Permalink
Client: Reset camera rotation on respawn
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix committed Dec 9, 2023
1 parent 1d9616b commit 199d1c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Game/States/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ namespace tsom
m_onControlledEntityChanged.Connect(m_stateData->sessionHandler->OnControlledEntityChanged, [&](entt::handle entity)
{
m_controlledEntity = entity;
if (m_controlledEntity)
{
auto& entityNode = entity.get<Nz::NodeComponent>();
m_cameraRotation = entityNode.GetRotation();
}
});

m_onChunkCreate.Connect(m_stateData->sessionHandler->OnChunkCreate, [&](const Packets::ChunkCreate& chunkCreate)
Expand Down

0 comments on commit 199d1c8

Please sign in to comment.