From bc82c2213399111b9b7be2891b9120f52f6a0c09 Mon Sep 17 00:00:00 2001 From: Chris Yeninas <844685+PhantomGamers@users.noreply.github.com> Date: Mon, 23 May 2022 22:31:38 -0400 Subject: [PATCH] fix precision of aspectratio variable the var was being truncated too much resulting in a slightly off hex value. this was not a problem in most instances but in certain titles this could result in irregular behavior and crashes. --- SUWSF/GenericPatch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SUWSF/GenericPatch.cpp b/SUWSF/GenericPatch.cpp index b453372..0131f75 100644 --- a/SUWSF/GenericPatch.cpp +++ b/SUWSF/GenericPatch.cpp @@ -8,6 +8,7 @@ #include #include "../external/tinyexpr/tinyexpr.h" #include "../external/Hooking.Patterns/Hooking.Patterns.h" +#include void GenericPatch::Init() { @@ -110,7 +111,7 @@ std::vector GenericPatch::GetConfigs() { boost::replace_all(config.val, "width", std::to_string(UserSettings::config.width)); boost::replace_all(config.val, "height", std::to_string(UserSettings::config.height)); - boost::replace_all(config.val, "aspectratio", std::to_string(UserSettings::config.aspectratio)); + boost::replace_all(config.val, "aspectratio", boost::lexical_cast(UserSettings::config.aspectratio)); int error = -1; double d = te_interp(config.val.c_str(), &error);