Skip to content

Fix crash when FOV is equal to zero#669

Open
qwasdrizzel wants to merge 6 commits intosmartcmd:mainfrom
qwasdrizzel:main
Open

Fix crash when FOV is equal to zero#669
qwasdrizzel wants to merge 6 commits intosmartcmd:mainfrom
qwasdrizzel:main

Conversation

@qwasdrizzel
Copy link
Contributor

Description

Fixes a crash when FOV is equal to zero.

Changes

Added a if statement inside of GameRenderer::getFov to check if m_fov is less than 1. If the FOV is less than one it sets it to 0.01.

Previous Behavior

Crashed when FOV was equal to zero.

Root Cause

DirectX caused it with the expression !XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)

New Behavior

Limits FOV to 0.01.

Fix Implementation

If statement limiting m_fov to 0.01 if under 1.

AI Use Disclosure

No AI.

@simulpingus
Copy link
Contributor

when would this crash ever realistically happen

@codeHusky
Copy link
Collaborator

Shouldn't you just set FOV to 1 instead of 0.01 here? Seems like a random value to force at FOV 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants