1
0
mirror of synced 2024-11-12 01:20:49 +01:00

Cruisn Blast improvements

This commit is contained in:
Mike Waye 2024-04-19 18:58:05 +01:00
parent 2aa65fe9ee
commit ca0bf28b42

View File

@ -22,6 +22,7 @@ extern int EnableDamper;
extern int DamperStrength;
static float lastFF = 0;
static int currentScreen = 0;
static int(__cdecl* Wheel_SetHookOrig)(float param_1);
static int __cdecl Wheel_SetHook(float param_1)
@ -35,17 +36,33 @@ static int __cdecl Wheel_SetHook(float param_1)
int puVar7 = myHelpers->ReadInt32(0x8babbc0, false); //0 menus, 1 game
if (puVar7 == 1)
{
if (currentScreen == 0)
{
//in game - turn on wheel effects
myHelpers->WriteByte(0x9c28504, 1, false);
lastFF = param_1;
currentScreen = 1;
lastFF = 0;
}
else
{
lastFF = param_1;
}
}
else
{
if (currentScreen == 1)
{
//not in game turn off wheel effects
myHelpers->WriteByte(0x9c28504, 0, false);
lastFF = 0;
currentScreen = 0;
}
else
{
lastFF = puVar1;
}
}
if (lastFF >= 0) {
myTriggers->Rumble(0, lastFF, 100.0);
myTriggers->Constant(myConstants->DIRECTION_FROM_RIGHT, lastFF);
@ -58,7 +75,6 @@ static int __cdecl Wheel_SetHook(float param_1)
}
void CruisnBlast::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
if (!init)
{