port: fix npc footsteps at high framerates

This commit is contained in:
fgsfds committed 2023-11-15 00:25:01 +01:00
1 parent 9c7f348652
commit f394f209b2
1 file changed
+4 -3
+4 -3
View File
@@ -177,9 +177,10 @@ void footstepCheckDefault(struct chrdata *chr)
chr->footstep = 2; chr->footstep = 2;
} }
} else { } else {
#ifndef PLATFORM_N64 // fix spamming footsteps for 60fps port #ifndef PLATFORM_N64
if (g_Vars.lvupdate240 == LV_SLOMO_TICK_CAP) { // fix spamming footsteps at >= 60fps
s32 roundedframe = (s32)(frame*2); 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) { if (roundedframe == (g_FootstepAnims[i].frame1*2) && prevframe < g_FootstepAnims[i].frame1) {
chr->footstep = 1; chr->footstep = 1;
} else if (roundedframe == (g_FootstepAnims[i].frame2*2) && prevframe < g_FootstepAnims[i].frame2) { } else if (roundedframe == (g_FootstepAnims[i].frame2*2) && prevframe < g_FootstepAnims[i].frame2) {