mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add offroad gamepad rumble
This commit is contained in:
parent
17daf1aeba
commit
f7ca9043a1
1 changed files with 26 additions and 0 deletions
26
src/k_kart.c
26
src/k_kart.c
|
|
@ -12,6 +12,7 @@
|
|||
#include "doomdef.h"
|
||||
#include "hu_stuff.h"
|
||||
#include "g_game.h"
|
||||
#include "g_input.h" // for device rumble
|
||||
#include "m_random.h"
|
||||
#include "p_local.h"
|
||||
#include "p_slopes.h"
|
||||
|
|
@ -8336,6 +8337,31 @@ void K_KartPlayerAfterThink(player_t *player)
|
|||
|
||||
player->nullHitlag = 0;
|
||||
}
|
||||
|
||||
// Apply rumble to player if local to machine and not in demo playback
|
||||
if (!demo.playback)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (player == &players[g_localplayers[i]])
|
||||
{
|
||||
UINT16 low = 0;
|
||||
UINT16 high = 0;
|
||||
|
||||
if (player->offroad > 0 && (player->mo->momx != 0 || player->mo->momy != 0 || player->mo->momz != 0))
|
||||
{
|
||||
low = 65536 / 4;
|
||||
high = 65536 / 4;
|
||||
}
|
||||
|
||||
G_PlayerDeviceRumble(i, low, high);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue