diff --git a/src/game/nbomb.c b/src/game/nbomb.c index 28bbb643a..b5f4fa72b 100644 --- a/src/game/nbomb.c +++ b/src/game/nbomb.c @@ -281,6 +281,9 @@ void nbombReset(struct nbomb *nbomb) #if VERSION >= VERSION_PAL_BETA nbomb->radius = 0; #endif +#ifndef PLATFORM_N64 + nbomb->spawnframe240 = g_Vars.lvframe240; +#endif } /** @@ -523,9 +526,14 @@ void nbombTick(struct nbomb *nbomb) { if (nbomb->age240 >= 0) { s32 age60; +#ifdef PLATFORM_N64 s32 increment = (g_Vars.lvupdate240 + 2) >> 2; - nbomb->age240 += increment; +#else + s32 oldage240 = nbomb->age240; + nbomb->age240 = (g_Vars.lvframe240 - nbomb->spawnframe240) >> 2; + s32 increment = nbomb->age240 - oldage240; +#endif if (nbomb->age240 < TICKS(80)) { nbomb->radius = nbomb->age240 / (PAL ? 66.0f : 80.0f); diff --git a/src/include/types.h b/src/include/types.h index 159558c67..67a8eddaf 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -5510,6 +5510,9 @@ struct nbomb { struct prop *ownerprop; struct sndstate *audiohandle20; struct sndstate *audiohandle24; +#ifndef PLATFORM_N64 + s32 spawnframe240; // spawned on this frame +#endif }; struct roomacousticdata {