From 8b4d189c31f78921a999799d92f9ef7e536c4c1a Mon Sep 17 00:00:00 2001 From: Riasan Date: Tue, 23 May 2017 19:38:26 +0200 Subject: [PATCH] Changed: edit force_camera_fp command --HG-- branch : develop --- .../client/src/interface_v3/action_handler_move.cpp | 6 +++--- code/ryzom/client/src/user_entity.cpp | 11 ++++++----- code/ryzom/client/src/user_entity.h | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_move.cpp b/code/ryzom/client/src/interface_v3/action_handler_move.cpp index b33f71da5..d402f1750 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_move.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_move.cpp @@ -226,15 +226,15 @@ class CAHToggleCamera : public IActionHandler REGISTER_ACTION_HANDLER (CAHToggleCamera, "toggle_camera"); // ------------------------------------------------------------------------------------------------ -class CAHToggleForceFP : public IActionHandler +class CAHTForceFP : public IActionHandler { virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { // Change the camera view to first person - UserEntity->forceCamareaFirstPerson(); + UserEntity->forceCameraFirstPerson(); } }; -REGISTER_ACTION_HANDLER (CAHToggleForceFP, "force_camera_fp"); +REGISTER_ACTION_HANDLER (CAHTForceFP, "force_camera_fp"); // ------------------------------------------------------------------------------------------------ class CAHToggleNames : public IActionHandler diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index 5fd8c7dfb..cad200aeb 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -3214,10 +3214,10 @@ void CUserEntity::toggleCamera() }// toggleCamera // //----------------------------------------------- -// forceCamareaFirstPerson : +// forceCameraFirstPerson : // Force Camera to First Person View //----------------------------------------------- -void CUserEntity::forceCamareaFirstPerson() +void CUserEntity::forceCameraFirstPerson() { // You cannot change the camera view when dead. if(isDead()) @@ -3225,10 +3225,11 @@ void CUserEntity::forceCamareaFirstPerson() // Only if not inside a building. if(!UserEntity->forceIndoorFPV()) { - //Enter the 1st Person View Mode - UserEntity->viewMode(CUserEntity::FirstPV); + if (UserEntity->viewMode() != CUserEntity::FirstPV) + //Enter the 1st Person View Mode + UserEntity->viewMode(CUserEntity::FirstPV); } -}// forceCamareaFirstPerson // +}// forceCameraFirstPerson // //--------------------------------------------------- // getScale : diff --git a/code/ryzom/client/src/user_entity.h b/code/ryzom/client/src/user_entity.h index e79af8dba..7e693536b 100644 --- a/code/ryzom/client/src/user_entity.h +++ b/code/ryzom/client/src/user_entity.h @@ -370,7 +370,7 @@ public: /// Toggle Camera (First/Third Person) void toggleCamera(); /// Force Camera First Person View - void forceCamareaFirstPerson(); + void forceCameraFirstPerson(); //@} /// Return the entity scale. (return 1.0 if there is any problem).