From 735c4b67dc6f154c295b8033f7c4aa32d4e424ff Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 19 Jul 2026 02:35:47 +0200 Subject: [PATCH] move stairjank particles into K_MoveKartPlayer to where we also rotate the player also means we now use K_AltFlip :p also means the visual toggle now actually does prevent spawning them --- src/k_kart.c | 22 ++++++++++++++++++++++ src/p_map.c | 28 ---------------------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 0196bb521..e77c0b5ee 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7055,6 +7055,28 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // "Stair jank" visuals akin to RR if (cv_stairjank.value && player->stairjank > 0) { + // only spawn em once + if (player->stairjank > 8) + { + // 90 degrees to direction you're facing + fixed_t dirx = -FINESINE(player->mo->angle>>ANGLETOFINESHIFT); + fixed_t diry = FINECOSINE(player->mo->angle>>ANGLETOFINESHIFT); + fixed_t offset = player->mo->radius; + + dirx = K_AltFlip(-dirx, 4); + diry = K_AltFlip(-diry, 4); + + mobj_t * spark = P_SpawnMobj(player->mo->x + FixedMul(dirx, offset), player->mo->y + FixedMul(diry, offset), player->mo->z, MT_DRIFTDUST); + spark->momx = FixedMul(dirx, FRACUNIT) + (6 + ((int)leveltime % 5))*(player->mo->momx)/10; + spark->momy = FixedMul(diry, FRACUNIT) + (6 + ((int)leveltime % 5))*(player->mo->momy)/10; + spark->momz = 5*FRACUNIT; + spark->scale = mapobjectscale/5; + spark->destscale = mapobjectscale/2; + spark->islocal = true; + spark->color = SKINCOLOR_WHITE; + P_SetTarget(&spark->target, player->mo); + } + player->mo->temprollangle += K_StairJankFlip(ANGLE_11hh / 2 / (17 / player->stairjank)); // TODO: make strength adjustable? } diff --git a/src/p_map.c b/src/p_map.c index 646e88708..5436e144c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2614,34 +2614,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul // Can't spawn things during P_TryMove, because global variables :) - // TODO - move this elsewhere later, should probably be safe in K_KartPlayerThink or something - /*if (!thing->player->stairjank) - { - // 90 degrees to direction you're facing - fixed_t dirx = -FINESINE(thing->angle>>ANGLETOFINESHIFT); - fixed_t diry = FINECOSINE(thing->angle>>ANGLETOFINESHIFT); - fixed_t offset = thing->radius; - - if (leveltime % 8 < 4) - { - dirx = -dirx; - diry = -diry; - } - - mobj_t * spark = P_SpawnMobj(thing->x + FixedMul(dirx, offset), thing->y + FixedMul(diry, offset), thing->z, MT_DRIFTDUST); - spark->momx = FixedMul(dirx, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momx)/10; - spark->momy = FixedMul(diry, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momy)/10; - spark->momz = 5*FRACUNIT; - spark->scale = mapobjectscale/5; - spark->destscale = mapobjectscale/2; - spark->islocal = true; - //spark->fuse = 9; - spark->color = SKINCOLOR_WHITE; - //spark->cusval = K_StairJankFlip(ANGLE_90); - P_SetTarget(&spark->target, thing); - //P_SetTarget(&spark->owner, thing); - //spark->renderflags |= RF_REDUCEVFX; - }*/ thing->player->stairjank = 9; //thing->player->stairjank = 17;