1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-02 04:06:40 +00:00

Merge branch 'fix_7223' into 'master'

Fix #7223

Closes #7223

See merge request OpenMW/openmw!2736

(cherry picked from commit a43b6fba4b)

0c3237ad Fix #7223
This commit is contained in:
psi29a 2023-02-18 22:19:00 +00:00
parent c9eb08dbc3
commit d95a03a8ba
2 changed files with 14 additions and 7 deletions

View file

@ -210,7 +210,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())
{

View file

@ -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
@ -180,17 +186,15 @@ end
local function onFrame(dt)
if core.isWorldPaused() then return end
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)