From 506917e24b8f38a1b2402598e002c81dd1498ac5 Mon Sep 17 00:00:00 2001 From: yamamama Date: Wed, 24 Dec 2025 18:42:47 -0500 Subject: [PATCH 1/6] Shrink Fix part 1: Fudge spring launch scales --- src/k_items.c | 7 +++++++ src/p_map.c | 28 ++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/k_items.c b/src/k_items.c index b387aa68d..b03a42b66 100644 --- a/src/k_items.c +++ b/src/k_items.c @@ -2523,6 +2523,13 @@ INT16 K_GetShrinkTime(const player_t *player) boolean K_IsAltShrunk(const player_t *player) { + if (!player) + { +#ifdef PARANOIA + CONS_Printf("K_IsAltShrunk: passed NULL player\n"); +#endif + return false; + } return player->growshrinktimer < 0 && K_IsKartItemAlternate(KITEM_SHRINK); } diff --git a/src/p_map.c b/src/p_map.c index e15912093..fbea090d9 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -46,6 +46,8 @@ #include "k_objects.h" +#include "k_items.h" + tm_t g_tm = {0}; void P_RestoreTMStruct(tm_t tmrestore) @@ -292,8 +294,17 @@ P_DoSpringEx fixed_t horizspeed, angle_t finalAngle) { - const fixed_t hscale = mapobjectscale + (mapobjectscale - object->scale); - const fixed_t vscale = mapobjectscale + (object->scale - mapobjectscale); + fixed_t objscale = object->scale; + + if (object->player && K_IsAltShrunk(object->player)) + { + // For Alt. Shrunk players: fudge the scale calculation. + // Pretend we're bigger than we actually are, so the game handles springs as such. + objscale = max(object->scale, mapobjectscale); + } + + const fixed_t hscale = mapobjectscale + (mapobjectscale - objscale); + const fixed_t vscale = mapobjectscale + (objscale - mapobjectscale); object->standingslope = NULL; // Okay, now we know it's not going to be relevant - no launching off at silly angles for you. object->terrain = NULL; @@ -335,8 +346,17 @@ P_DoSpringEx // boolean P_DoSpring(mobj_t *spring, mobj_t *object) { - const fixed_t hscale = mapobjectscale + (mapobjectscale - object->scale); - const fixed_t vscale = mapobjectscale + (object->scale - mapobjectscale); + fixed_t objscale = object->scale; + + if (object->player && K_IsAltShrunk(object->player)) + { + // For Alt. Shrunk players: fudge the scale calculation. + // Pretend we're bigger than we actually are, so the game handles springs as such. + objscale = max(object->scale, mapobjectscale); + } + + const fixed_t hscale = mapobjectscale + (mapobjectscale - objscale); + const fixed_t vscale = mapobjectscale + (objscale - mapobjectscale); fixed_t offx, offy; fixed_t vertispeed = spring->info->mass; fixed_t horizspeed = spring->info->damage; From 18146e5d69e9c4e8aad0786a91a27ce56438c144 Mon Sep 17 00:00:00 2001 From: yamamama Date: Wed, 24 Dec 2025 21:28:25 -0500 Subject: [PATCH 2/6] Shrink Fix part 2: Make springs catch smaller players no matter what --- src/p_map.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index fbea090d9..a0a7265e0 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -543,6 +543,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) static BlockItReturn_t PIT_CheckThing(mobj_t *thing) { fixed_t blockdist; + boolean shrinkleeway = false; if (g_tm.thing == NULL || P_MobjWasRemoved(g_tm.thing) == true) return BMIT_STOP; // func just popped our g_tm.thing, cannot continue. @@ -573,6 +574,35 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) blockdist = thing->radius + g_tm.thing->radius; + if (thing->flags & MF_SPRING) + { + // Testing a spring object; check if the other object: + // * Has a player + // * Is smaller than usual + // If this is true, fudge collisions for this interaction. + if (g_tm.thing->player && (g_tm.thing->scale < mapobjectscale)) + { + const fixed_t radiusrescale = FixedDiv(mapobjectscale, g_tm.thing->scale); + + blockdist = thing->radius + FixedMul(g_tm.thing->radius, radiusrescale); + shrinkleeway = true; + } + } + else if (g_tm.thing->flags & MF_SPRING) + { + // Testing a spring object; check if the other object: + // * Has a player + // * Is smaller than usual + // If this is true, fudge collisions for this interaction. + if (thing->player && (thing->scale < mapobjectscale)) + { + const fixed_t radiusrescale = FixedDiv(mapobjectscale, thing->scale); + + blockdist = FixedMul(thing->radius, radiusrescale) + g_tm.thing->radius; + shrinkleeway = true; + } + } + if (abs(thing->x - g_tm.x) >= blockdist || abs(thing->y - g_tm.y) >= blockdist) return BMIT_CONTINUE; // didn't hit it @@ -1263,7 +1293,20 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) P_DoFanAndGasJet(thing, g_tm.thing); else if (thing->flags & MF_SPRING) { - if ( thing->z <= g_tm.thing->z + g_tm.thing->height + fixed_t tm_thing_height = 0; + + if (shrinkleeway) + { + const fixed_t radiusrescale = FixedDiv(mapobjectscale, g_tm.thing->scale); + + tm_thing_height = FixedMul(g_tm.thing->height, radiusrescale); + } + else + { + tm_thing_height = g_tm.thing->height; + } + + if ( thing->z <= g_tm.thing->z + tm_thing_height && g_tm.thing->z <= thing->z + thing->height) if (P_DoSpring(thing, g_tm.thing)) return BMIT_ABORT; From d7c516777b012149b48d16bc7a35de0b0a82053e Mon Sep 17 00:00:00 2001 From: yamamama Date: Wed, 24 Dec 2025 21:33:41 -0500 Subject: [PATCH 3/6] Revise this a bit to take smaller players overall into account Paranoia change, mostly --- src/p_map.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index a0a7265e0..25825ec38 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -296,10 +296,12 @@ P_DoSpringEx { fixed_t objscale = object->scale; - if (object->player && K_IsAltShrunk(object->player)) + if (object->player) { - // For Alt. Shrunk players: fudge the scale calculation. - // Pretend we're bigger than we actually are, so the game handles springs as such. + // For smaller players: fudge the scale calculation by adding a minimum scale. + // In certain cases, the game will pretend they're bigger than they actually are, + // so the game handles springs as such. + // Alt. Shrink *especially* needs this change! objscale = max(object->scale, mapobjectscale); } @@ -348,10 +350,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) { fixed_t objscale = object->scale; - if (object->player && K_IsAltShrunk(object->player)) + if (object->player) { - // For Alt. Shrunk players: fudge the scale calculation. - // Pretend we're bigger than we actually are, so the game handles springs as such. + // For smaller players: fudge the scale calculation by adding a minimum scale. + // In certain cases, the game will pretend they're bigger than they actually are, + // so the game handles springs as such. + // Alt. Shrink *especially* needs this change! objscale = max(object->scale, mapobjectscale); } From 94ea4e06143c7142c2fc917499cff68cce63a5da Mon Sep 17 00:00:00 2001 From: yamamama Date: Wed, 24 Dec 2025 22:28:49 -0500 Subject: [PATCH 4/6] Forgot about goddamn pogosprings --- src/k_kart.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index b0d67bd43..62b43bbf2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4891,7 +4891,18 @@ void K_DoSneaker(player_t *player, INT32 type) void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) { - const fixed_t vscale = mapobjectscale + (mo->scale - mapobjectscale); + fixed_t objscale = mo->scale; + + if (mo->player) + { + // For smaller players: fudge the scale calculation by adding a minimum scale. + // In certain cases, the game will pretend they're bigger than they actually are, + // so the game handles springs as such. + // Alt. Shrink *especially* needs this change! + objscale = max(mo->scale, mapobjectscale); + } + + const fixed_t vscale = mapobjectscale + (objscale - mapobjectscale); if (mo->player && mo->player->spectator) return; From 33ca21b9f2702a85009987cfec028bb3b6709581 Mon Sep 17 00:00:00 2001 From: yamamama Date: Wed, 24 Dec 2025 22:47:37 -0500 Subject: [PATCH 5/6] Terraindef bullshit --- src/k_terrain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/k_terrain.c b/src/k_terrain.c index 96c7f7088..0c3662d63 100644 --- a/src/k_terrain.c +++ b/src/k_terrain.c @@ -763,7 +763,11 @@ void K_ProcessTerrainEffect(mobj_t *mo) // Pogospring panel if (terrain->pogoSpring > 0 && !(mo->eflags & MFE_SPRUNG)) { - const fixed_t hscale = mapobjectscale + (mapobjectscale - player->mo->scale); + // I'm not including the "minimum scale" rant here again. Look at P_DoSpring for that. + // Just know this fixes things with Alt. Shrink. + const fixed_t objscale = max(player->mo->scale, mapobjectscale); + + const fixed_t hscale = mapobjectscale + (mapobjectscale - objscale); fixed_t minspeed = terrain->pogoSpringMin*hscale; fixed_t maxspeed = terrain->pogoSpringMax*hscale; angle_t pushangle = FixedHypot(player->mo->momx, player->mo->momy) ? R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy) : player->mo->angle; From 0adff9842cbf25ade0d1c36d523094170d3d57ce Mon Sep 17 00:00:00 2001 From: yamamama Date: Wed, 24 Dec 2025 22:55:39 -0500 Subject: [PATCH 6/6] :patrick_mouth: --- src/p_spec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index 39fd9b935..241dacd18 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5197,7 +5197,8 @@ static void P_ProcessPogoSpring(player_t *player, boolean isTouching, int type) return; } - const fixed_t hscale = mapobjectscale + (mapobjectscale - player->mo->scale); + const fixed_t playerscale = max(mapobjectscale, player->mo->scale); + const fixed_t hscale = mapobjectscale + (mapobjectscale - playerscale); const fixed_t minspeed = 24*hscale; const fixed_t maxspeed = 28*hscale; angle_t pushangle = FixedHypot(player->mo->momx, player->mo->momy) ? R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy) : player->mo->angle;