diff --git a/src/k_kart.c b/src/k_kart.c index 848a7acdc..14ce6f29e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3802,13 +3802,33 @@ void K_RemoveGrowShrink(player_t *player) boolean K_IsBigger(mobj_t *compare, mobj_t *other) { + fixed_t compareScale, otherScale; + if ((compare == NULL || P_MobjWasRemoved(compare) == true) || (other == NULL || P_MobjWasRemoved(other) == true)) { return false; } - return (compare->scale > other->scale + (mapobjectscale / 4)); + if ((compareScale = P_GetMobjDefaultScale(compare)) != FRACUNIT) + { + compareScale = FixedDiv(compare->scale, compareScale); + } + else + { + compareScale = compare->scale; + } + + if ((otherScale = P_GetMobjDefaultScale(other)) != FRACUNIT) + { + otherScale = FixedDiv(other->scale, otherScale); + } + else + { + otherScale = other->scale; + } + + return (compareScale > otherScale + (mapobjectscale / 4)); } static fixed_t K_TumbleZ(mobj_t *mo, fixed_t input) diff --git a/src/p_local.h b/src/p_local.h index 4c6b44449..12e17178f 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -256,6 +256,7 @@ mobjtype_t P_GetMobjtype(UINT16 mthingtype); void P_RespawnSpecials(void); +fixed_t P_GetMobjDefaultScale(mobj_t *mobj); mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type); void P_CalculatePrecipFloor(precipmobj_t *mobj); diff --git a/src/p_mobj.c b/src/p_mobj.c index 599dd37e8..c3be0bd2f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10496,6 +10496,20 @@ void P_SceneryThinker(mobj_t *mobj) // GAME SPAWN FUNCTIONS // +fixed_t P_GetMobjDefaultScale(mobj_t *mobj) +{ + switch(mobj->type) + { + case MT_SPECIALSTAGEARCH: + return 5*FRACUNIT; + case MT_SPECIALSTAGEBOMB: + return 3*FRACUNIT/4; + default: + break; + } + return FRACUNIT; +} + static void P_DefaultMobjShadowScale(mobj_t *thing) { thing->shadowscale = 0; @@ -10596,6 +10610,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) SINT8 sc = -1; state_t *st; mobj_t *mobj; + fixed_t scale; if (type == MT_NULL) { @@ -10648,13 +10663,12 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // All mobjs are created at 100% scale. mobj->scale = FRACUNIT; - mobj->destscale = mobj->scale; - mobj->scalespeed = FRACUNIT/12; + mobj->destscale = mapobjectscale; + mobj->scalespeed = mapobjectscale/12; - if (mapobjectscale != FRACUNIT) //&& !(mobj->type == MT_BLACKEGGMAN) + if ((scale = P_GetMobjDefaultScale(mobj)) != FRACUNIT) { - mobj->destscale = mapobjectscale; - mobj->scalespeed = mapobjectscale/12; + mobj->destscale = FixedMul(mobj->destscale, scale); } // Sprite rendering