diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a48d60c..36ea55a65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,6 +115,7 @@ Bug #5069: Blocking creatures' attacks doesn't degrade shields Bug #5074: Paralyzed actors greet the player Bug #5075: Enchanting cast style can be changed if there's no object + Bug #5078: DisablePlayerLooking is broken Bug #5082: Scrolling with controller in GUI mode is broken Bug #5089: Swimming/Underwater creatures only swim around ground level Bug #5092: NPCs with enchanted weapons play sound when out of charges diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 256c8b1d5..63f69ab65 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -407,7 +407,6 @@ namespace MWBase virtual void togglePreviewMode(bool enable) = 0; virtual bool toggleVanityMode(bool enable) = 0; virtual void allowVanityMode(bool allow) = 0; - virtual void togglePlayerLooking(bool enable) = 0; virtual void changeVanityModeScale(float factor) = 0; virtual bool vanityRotateCamera(float * rot) = 0; virtual void setCameraDistance(float dist, bool adjust = false, bool override = true)=0; diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index efe85a3bb..18da9c32a 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -594,7 +594,7 @@ namespace MWInput rot[2] = xAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f) * (mInvertX ? -1 : 1); // Only actually turn player when we're not in vanity mode - if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot)) + if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot) && mControlSwitch["playerlooking"]) { mPlayer->yaw(rot[2]); mPlayer->pitch(rot[0]); @@ -832,9 +832,6 @@ namespace MWInput void InputManager::toggleControlSwitch (const std::string& sw, bool value) { - if (mControlSwitch[sw] == value) { - return; - } /// \note 7 switches at all, if-else is relevant if (sw == "playercontrols" && !value) { mPlayer->setLeftRight(0); @@ -846,8 +843,8 @@ namespace MWInput mPlayer->setUpDown(0); } else if (sw == "vanitymode") { MWBase::Environment::get().getWorld()->allowVanityMode(value); - } else if (sw == "playerlooking") { - MWBase::Environment::get().getWorld()->togglePlayerLooking(value); + } else if (sw == "playerlooking" && !value) { + MWBase::Environment::get().getWorld()->rotateObject(mPlayer->getPlayer(), 0.f, 0.f, 0.f); } mControlSwitch[sw] = value; } @@ -981,7 +978,7 @@ namespace MWInput rot[2] = -x; // Only actually turn player when we're not in vanity mode - if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot)) + if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot) && mControlSwitch["playerlooking"]) { mPlayer->yaw(x); mPlayer->pitch(y); diff --git a/apps/openmw/mwrender/camera.cpp b/apps/openmw/mwrender/camera.cpp index 74f2ba911..e0818101d 100644 --- a/apps/openmw/mwrender/camera.cpp +++ b/apps/openmw/mwrender/camera.cpp @@ -48,7 +48,6 @@ namespace MWRender mAnimation(nullptr), mFirstPersonView(true), mPreviewMode(false), - mFreeLook(true), mNearest(30.f), mFurthest(800.f), mIsNearest(false), @@ -393,11 +392,6 @@ namespace MWRender camera = focal + offset; } - void Camera::togglePlayerLooking(bool enable) - { - mFreeLook = enable; - } - bool Camera::isVanityOrPreviewModeEnabled() { return mPreviewMode || mVanity.enabled; diff --git a/apps/openmw/mwrender/camera.hpp b/apps/openmw/mwrender/camera.hpp index db5ad25f0..573cf936f 100644 --- a/apps/openmw/mwrender/camera.hpp +++ b/apps/openmw/mwrender/camera.hpp @@ -37,7 +37,6 @@ namespace MWRender bool mFirstPersonView; bool mPreviewMode; - bool mFreeLook; float mNearest; float mFurthest; bool mIsNearest; @@ -119,8 +118,6 @@ namespace MWRender /// Stores focal and camera world positions in passed arguments void getPosition(osg::Vec3f &focal, osg::Vec3f &camera); - void togglePlayerLooking(bool enable); - bool isVanityOrPreviewModeEnabled(); bool isNearest(); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 0d9cbd9b0..c361ddf03 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1353,11 +1353,6 @@ namespace MWRender mCamera->allowVanityMode(allow); } - void RenderingManager::togglePlayerLooking(bool enable) - { - mCamera->togglePlayerLooking(enable); - } - void RenderingManager::changeVanityModeScale(float factor) { if(mCamera->isVanityOrPreviewModeEnabled()) diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 7fb436863..49da50be3 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -208,7 +208,6 @@ namespace MWRender void togglePreviewMode(bool enable); bool toggleVanityMode(bool enable); void allowVanityMode(bool allow); - void togglePlayerLooking(bool enable); void changeVanityModeScale(float factor); /// temporarily override the field of view with given value. diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index ef65ec162..5babc57be 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2398,11 +2398,6 @@ namespace MWWorld mRendering->allowVanityMode(allow); } - void World::togglePlayerLooking(bool enable) - { - mRendering->togglePlayerLooking(enable); - } - void World::changeVanityModeScale(float factor) { mRendering->changeVanityModeScale(factor); diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 0284d8fee..0f090bf8d 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -528,8 +528,6 @@ namespace MWWorld void allowVanityMode(bool allow) override; - void togglePlayerLooking(bool enable) override; - void changeVanityModeScale(float factor) override; bool vanityRotateCamera(float * rot) override;