Shrink Fix part 1: Fudge spring launch scales

This commit is contained in:
yamamama 2025-12-24 18:42:47 -05:00
parent aede690bb7
commit 506917e24b
2 changed files with 31 additions and 4 deletions

View file

@ -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);
}

View file

@ -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;