Skip to content

Commit

Permalink
fix precision of aspectratio variable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PhantomGamers committed May 24, 2022
1 parent cf8e194 commit bc82c22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SUWSF/GenericPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <string>
#include "../external/tinyexpr/tinyexpr.h"
#include "../external/Hooking.Patterns/Hooking.Patterns.h"
#include <boost/lexical_cast.hpp>

void GenericPatch::Init()
{
Expand Down Expand Up @@ -110,7 +111,7 @@ std::vector<GenericPatch::Config> 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<std::string>(UserSettings::config.aspectratio));
int error = -1;
double d = te_interp(config.val.c_str(), &error);

Expand Down

0 comments on commit bc82c22

Please sign in to comment.