Skip to content

Commit

Permalink
Merge branch 'fix_7223' into 'master'
Browse files Browse the repository at this point in the history
Fix #7223

Closes #7223

See merge request OpenMW/openmw!2736
  • Loading branch information
psi29a committed Feb 18, 2023
2 parents 0f331a4 + 0c3237a commit a43b6fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions apps/openmw/mwrender/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ namespace MWRender
void Camera::setMode(Mode newMode, bool force)
{
if (mMode == newMode)
{
mQueuedMode = std::nullopt;
return;
}
Mode oldMode = mMode;
if (!force && (newMode == Mode::FirstPerson || oldMode == Mode::FirstPerson) && mAnimation
&& !mAnimation->upperBodyReady())
Expand Down
18 changes: 11 additions & 7 deletions files/data/scripts/omw/camera/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ local function updatePOV(dt)
end
end
camera.setMode(primaryMode)
if camera.getMode() == MODE.Preview then
-- If Preview -> FirstPerson change is queued (because of 3rd person animation),
-- then first exit Preview by switching to ThirdPerson, and then queue the switch to FirstPerson.
camera.setMode(MODE.ThirdPerson)
camera.setMode(MODE.FirstPerson)
end
previewTimer = 0
end
end
Expand Down Expand Up @@ -186,17 +192,15 @@ local function onFrame(dt)
if core.isWorldPaused() then return end
updateIdleTimer(dt)
local mode = camera.getMode()
if mode == MODE.FirstPerson or mode == MODE.ThirdPerson then
if (mode == MODE.FirstPerson or mode == MODE.ThirdPerson) and not camera.getQueuedMode() then
primaryMode = mode
end
if mode ~= MODE.Static then
if not camera.getQueuedMode() or camera.getQueuedMode() == MODE.Preview then
if noModeControl == 0 then
updatePOV(dt)
updateVanity(dt)
end
updateStandingPreview()
if noModeControl == 0 then
updatePOV(dt)
updateVanity(dt)
end
updateStandingPreview()
updateCrosshair()
end
applyControllerZoom(dt)
Expand Down

0 comments on commit a43b6fb

Please sign in to comment.