From 093073ca8cab0898f3502760bef2c495dd89220a Mon Sep 17 00:00:00 2001 From: Aaron M Date: Thu, 9 Jan 2020 15:18:26 +1300 Subject: [PATCH] Update snocross --- Game Files/SnoCross.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Game Files/SnoCross.cpp b/Game Files/SnoCross.cpp index 348d85c..7d5c6e9 100644 --- a/Game Files/SnoCross.cpp +++ b/Game Files/SnoCross.cpp @@ -17,23 +17,29 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>. void SnoCross::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) { float ff = helpers->ReadFloat32(0x99AB6C, false); + static float oldff = 0; + float newff = ff; helpers->log("got value: "); std::string ffs = std::to_string(ff); helpers->log((char*)ffs.c_str()); - if (ff > 0) + if (oldff != newff) { - double percentForce = ff / 1.24; - double percentLength = 100; - triggers->Rumble(percentForce, 0, percentLength); - triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); - } - else if (ff < 0) - { - double percentForce = -ff / 1.24; - double percentLength = 100; - triggers->Rumble(0, percentForce, percentLength); - triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); + if (ff > 0) + { + double percentForce = ff / 1.2401; + double percentLength = 100; + triggers->Rumble(0, percentForce, percentLength); + triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); + } + else if (ff < 0) + { + double percentForce = -ff / 1.2401; + double percentLength = 100; + triggers->Rumble(percentForce, 0, percentLength); + triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); + } } + oldff = newff; } \ No newline at end of file