Only allow vertical view shifting when 3D FOV is enabled #36196
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Close exploit that allowed peeking through floors and ceilings."
Purpose of change
Fixes #30300
Basically reverts #34075
We accidentally enabled shifting the game point of view when 3D FOV was disabled, which can not possibly provide correct behaviour. The result was that when shifting the view to a different z-level, the map would be drawn as if the player were at that location, even if that location is unreachable for the player.
Describe the solution
Check the 3D_FOV option in the two places where this shifting occurred, and if it is not true, do not allow shifting.
Testing
The two use cases I'm aware of were invoking "look around", bound by default to ';' and then using '<' or '>' to shift the level, or entering the aim menu, bound by default to 'f' (when wielding a ranged weapon), and then invoking "look up" or "look down", which are not bound by default.
Alternatives
Instead of disabling look up/look down, it might be beneficial to enable the feature, but not run FOV on the new map level, instead clearing it so that the game can at least display map memory for previously visited areas.
Additional context
There is no need to try to extend this functionality to be usable when 3D FOV is disabled, this kind of thing is exactly why 3D FOV needs to exist.