From f394f209b2d73fd24f417c9e7bb27f84ed1d777f Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 15 Nov 2023 00:25:01 +0100 Subject: [PATCH] port: fix npc footsteps at high framerates --- src/game/footstep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/footstep.c b/src/game/footstep.c index ddbcc3546..2480ad470 100644 --- a/src/game/footstep.c +++ b/src/game/footstep.c @@ -177,9 +177,10 @@ void footstepCheckDefault(struct chrdata *chr) chr->footstep = 2; } } else { -#ifndef PLATFORM_N64 // fix spamming footsteps for 60fps port - if (g_Vars.lvupdate240 == LV_SLOMO_TICK_CAP) { - s32 roundedframe = (s32)(frame*2); +#ifndef PLATFORM_N64 + // fix spamming footsteps at >= 60fps + if (g_Vars.lvupdate240 < 4) { + const s32 roundedframe = (s32)(frame * (4.f / (f32)g_Vars.lvupdate240)); if (roundedframe == (g_FootstepAnims[i].frame1*2) && prevframe < g_FootstepAnims[i].frame1) { chr->footstep = 1; } else if (roundedframe == (g_FootstepAnims[i].frame2*2) && prevframe < g_FootstepAnims[i].frame2) {