diff --git a/src/k_kart.c b/src/k_kart.c index 561eb28fa..1bde0b841 100644 --- a/src/k_kart.c +++ b/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; + } + } + } } /*--------------------------------------------------