Skip to content

Commit

Permalink
Ultrawide: Forgot to protect FOV map
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jun 4, 2023
1 parent 007b908 commit 8bca458
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/mods/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,15 @@ void Graphics::set_vertical_fov(bool enable) {
if (m_ultrawide_fov->value() && get_fov_method != nullptr && set_fov_method != nullptr && get_aspect_method != nullptr) {
const auto fov = get_fov_method->call<float>(sdk::get_thread_context(), camera);

if (!m_fov_map.contains(camera)) {
m_fov_map[camera] = fov;
utility::re_managed_object::add_ref(camera);
} else {
m_fov_map[camera] = fov;
{
std::scoped_lock _{m_fov_mutex};

if (!m_fov_map.contains(camera)) {
m_fov_map[camera] = fov;
utility::re_managed_object::add_ref(camera);
} else {
m_fov_map[camera] = fov;
}
}

if (!was_vertical_fov_enabled) {
Expand Down

0 comments on commit 8bca458

Please sign in to comment.