diff --git a/src/k_collide.c b/src/k_collide.c index 95fe28983..e0b3b2253 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -852,7 +852,7 @@ boolean K_SMKIceBlockCollide(mobj_t *t1, mobj_t *t2) /* if (t2->player && (t2->player->invincibilitytimer > 0 - || t2->player->growshrinktimer > 0)) + || K_IsBigger(t2, t1) == true)) return true; */ @@ -936,8 +936,8 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2) } // Cause stumble on scale difference - t1Condition = (t1->scale > t2->scale + (mapobjectscale/8)); - t2Condition = (t2->scale > t1->scale + (mapobjectscale/8)); + t1Condition = K_IsBigger(t1, t2); + t2Condition = K_IsBigger(t2, t1); if (t1Condition == true && t2Condition == false) { diff --git a/src/k_kart.c b/src/k_kart.c index aa4187aa1..63029dbc2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1409,7 +1409,7 @@ fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against) case MT_FALLINGROCK: if (against->player) { - if (against->player->invincibilitytimer || against->player->growshrinktimer > 0) + if (against->player->invincibilitytimer || K_IsBigger(against, mobj) == true) weight = 0; else weight = K_PlayerWeight(against, NULL); @@ -3935,6 +3935,17 @@ void K_RemoveGrowShrink(player_t *player) P_RestoreMusic(player); } +boolean K_IsBigger(mobj_t *compare, mobj_t *other) +{ + if ((compare == NULL || P_MobjWasRemoved(compare) == true) + || (other == NULL || P_MobjWasRemoved(other) == true)) + { + return false; + } + + return (compare->scale > other->scale + (mapobjectscale/2)); +} + static fixed_t K_TumbleZ(mobj_t *mo, fixed_t input) { // Scales base tumble gravity to FRACUNIT diff --git a/src/p_inter.c b/src/p_inter.c index b11c269e0..4974338bb 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -387,7 +387,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // kill if (player->invincibilitytimer > 0 - || player->growshrinktimer > 0 + || K_IsBigger(toucher, special) == true || player->flamedash > 0) { P_KillMobj(special, toucher, toucher, DMG_NORMAL); @@ -1926,7 +1926,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } } - if (player->invincibilitytimer > 0 || player->growshrinktimer > 0 || player->hyudorotimer > 0) + if (player->invincibilitytimer > 0 || K_IsBigger(target, inflictor) == true || player->hyudorotimer > 0) { // Full invulnerability K_DoInstashield(player); diff --git a/src/p_map.c b/src/p_map.c index 5b1827988..619f8698a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1368,7 +1368,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; // dead if (tmthing->player->invincibilitytimer > 0 - || tmthing->player->growshrinktimer > 0) + || K_IsBigger(tmthing, thing) == true) { if (thing->type == MT_BLUEROBRA_JOINT) P_KillMobj(thing->target, tmthing, tmthing, DMG_NORMAL); @@ -1394,7 +1394,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; // dead if (tmthing->player->invincibilitytimer > 0 - || tmthing->player->growshrinktimer > 0) + || K_IsBigger(tmthing, thing) == true) { P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL); return BMIT_CONTINUE; // kill @@ -1425,7 +1425,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) // kill if (tmthing->player->invincibilitytimer > 0 - || tmthing->player->growshrinktimer > 0) + || K_IsBigger(tmthing, thing) == true) { P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL); return BMIT_CONTINUE;