From bc0c4ad5f2f34ee151a5de972dee1c83470635ce Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Apr 2024 18:28:32 +0100 Subject: [PATCH] UDMF scaling of Item Capsules in GS_SPECIAL Can be expanded to all gametypes when we accept invalidating replays --- src/p_mobj.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 3607f4ec5..732dabcf5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -13505,9 +13505,24 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) // Ambush = double size (grounded) / half size (aerial) if (!(mthing->thing_args[2] & TMICF_INVERTSIZE) == !P_IsObjectOnGround(mobj)) { - mobj->extravalue1 = min(mobj->extravalue1 << 1, FixedDiv(MAPBLOCKSIZE, mobj->info->radius)); // don't make them larger than the blockmap can handle + mobj->extravalue1 <<= 1; mobj->scalespeed <<= 1; } + + if (gametype == GT_SPECIAL) + { + // TODO: When we invalidate replays, permit manual size changes everywhere + mobj->extravalue1 = FixedMul(mthing->scale, mobj->extravalue1); + mobj->scalespeed = FixedMul(mthing->scale, mobj->scalespeed); + } + + const fixed_t blimit = FixedDiv(MAPBLOCKSIZE, mobj->info->radius); + if (mobj->extravalue1 > blimit) + { + // don't make them larger than the blockmap can handle + mobj->extravalue1 = blimit; + } + break; } case MT_RANDOMAUDIENCE: