Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow vertical view shifting when 3D FOV is enabled #36196

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

kevingranade
Copy link
Member

@kevingranade kevingranade commented Dec 17, 2019

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.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Z-levels Levels below and above ground. labels Dec 17, 2019
@ZhilkinSerg ZhilkinSerg merged commit 8e1fee1 into CleverRaven:master Dec 17, 2019
@kevingranade kevingranade deleted the fix-vertical-peeking branch June 28, 2020 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Z-levels Levels below and above ground.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug/exploit - line of sight - zlevels
2 participants