From 4559bbe33664e6be2cfd242a9171f08ca5cbb72e Mon Sep 17 00:00:00 2001 From: praydog Date: Mon, 14 Oct 2024 01:24:25 -0700 Subject: [PATCH] Fix crash if resolution gets set to 0 --- src/mods/VR.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mods/VR.cpp b/src/mods/VR.cpp index cabf63a5..1431a6ee 100644 --- a/src/mods/VR.cpp +++ b/src/mods/VR.cpp @@ -2261,7 +2261,7 @@ uint32_t VR::get_hmd_width() const { return g_framework->get_rt_size().x; } - return get_runtime()->get_width(); + return std::max(get_runtime()->get_width(), 128); } uint32_t VR::get_hmd_height() const { @@ -2277,7 +2277,7 @@ uint32_t VR::get_hmd_height() const { return g_framework->get_rt_size().y; } - return get_runtime()->get_height(); + return std::max(get_runtime()->get_height(), 128); } void VR::on_draw_sidebar_entry(std::string_view name) {