From 17ab70eca5e9ac9562ec37d551e90a95d58a7ca4 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sun, 3 Nov 2019 01:14:21 +0500 Subject: [PATCH] More correct way of turning the camera in the direction of view when exiting demo_record This reverts commit e5db3fa93afc5ab152507f9b2c90d902f33bcf43. Reverts, because ForceTransform should only transform the entity position, not direction. --- src/xrEngine/FDemoRecord.cpp | 9 +++++++-- src/xrGame/Actor.cpp | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/xrEngine/FDemoRecord.cpp b/src/xrEngine/FDemoRecord.cpp index 804422bb43a..00532f7e6a3 100644 --- a/src/xrEngine/FDemoRecord.cpp +++ b/src/xrEngine/FDemoRecord.cpp @@ -426,9 +426,14 @@ void CDemoRecord::IR_OnKeyboardPress(int dik) #ifndef MASTER_GOLD if (dik == SDL_SCANCODE_RETURN) { - if (g_pGameLevel->CurrentEntity()) + IGameObject* entity = g_pGameLevel->CurrentEntity(); + if (entity) { - g_pGameLevel->CurrentEntity()->ForceTransform(m_Camera); + Fvector xyz; + m_Camera.getHPB(xyz); + + entity->ForceTransform(m_Camera); + entity->cam_Active()->Set(-xyz.x, -xyz.y, -xyz.z); fLifeTime = -1; } } diff --git a/src/xrGame/Actor.cpp b/src/xrGame/Actor.cpp index 8a6b8402102..37569222181 100644 --- a/src/xrGame/Actor.cpp +++ b/src/xrGame/Actor.cpp @@ -1599,9 +1599,6 @@ void CActor::ForceTransform(const Fmatrix& m) // character_physics_support()->set_movement_position( m.c ); // character_physics_support()->movement()->SetVelocity( 0, 0, 0 ); - Fvector xyz; - m.getHPB(xyz); - cam_Active()->Set(-xyz.x, -xyz.y, -xyz.z); character_physics_support()->ForceTransform(m); const float block_damage_time_seconds = 2.f; if (!IsGameTypeSingle())