diff --git a/src/k_collide.cpp b/src/k_collide.cpp index 38e69c8e4..d10dd845f 100644 --- a/src/k_collide.cpp +++ b/src/k_collide.cpp @@ -745,17 +745,6 @@ void K_LightningShieldAttack(mobj_t *actor, fixed_t size) boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2) { - if (t1->type == MT_PLAYER) - { - // Bubble Shield already has a hitbox, and it gets - // teleported every tic so the Bubble itself will - // always make contact with other objects. - // - // Therefore, we don't need a second, smaller hitbox - // on the player. It'll just cause unwanted hitlag. - return true; - } - if (t2->type == MT_PLAYER) { // Counter desyncs diff --git a/src/p_map.c b/src/p_map.c index 1f64946a3..782028790 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -522,6 +522,17 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) } } +static boolean P_BubbleCanReflect(mobj_t *t1, mobj_t *t2) +{ + return (t2->type == MT_ORBINAUT || t2->type == MT_JAWZ || t2->type == MT_GACHABOM + || t2->type == MT_BANANA || t2->type == MT_EGGMANITEM || t2->type == MT_BALLHOG + || t2->type == MT_SSMINE || t2->type == MT_LANDMINE || t2->type == MT_SINK + || t2->type == MT_GARDENTOP + || t2->type == MT_DROPTARGET + || t2->type == MT_KART_LEFTOVER + || (t2->type == MT_PLAYER && t1->target != t2)); +} + // // PIT_CheckThing // @@ -994,15 +1005,8 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; // Bubble Shield reflect - if (((thing->type == MT_BUBBLESHIELD && thing->target->player && thing->target->player->bubbleblowup) + if ((thing->type == MT_BUBBLESHIELD && thing->target->player && thing->target->player->bubbleblowup) || (thing->player && thing->player->bubbleblowup)) - && (tm.thing->type == MT_ORBINAUT || tm.thing->type == MT_JAWZ || tm.thing->type == MT_GACHABOM - || tm.thing->type == MT_BANANA || tm.thing->type == MT_EGGMANITEM || tm.thing->type == MT_BALLHOG - || tm.thing->type == MT_SSMINE || tm.thing->type == MT_LANDMINE || tm.thing->type == MT_SINK - || tm.thing->type == MT_GARDENTOP - || tm.thing->type == MT_DROPTARGET - || tm.thing->type == MT_KART_LEFTOVER - || (tm.thing->type == MT_PLAYER && thing->target != tm.thing))) { // see if it went over / under if (tm.thing->z > thing->z + thing->height) @@ -1010,17 +1014,21 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) if (tm.thing->z + tm.thing->height < thing->z) return BMIT_CONTINUE; // underneath - return K_BubbleShieldCollide(thing, tm.thing) ? BMIT_CONTINUE : BMIT_ABORT; + if (P_BubbleCanReflect(thing, tm.thing)) + { + // don't let player hitbox touch it too + if (thing->player) + return BMIT_CONTINUE; + return K_BubbleShieldCollide(thing, tm.thing) ? BMIT_CONTINUE : BMIT_ABORT; + } + else if ((tm.thing->flags & MF_SHOOTABLE) && !thing->player) + { + P_DamageMobj(tm.thing, thing, thing->target, 1, DMG_NORMAL); + return BMIT_CONTINUE; + } } - else if (((tm.thing->type == MT_BUBBLESHIELD && tm.thing->target->player && tm.thing->target->player->bubbleblowup) + else if ((tm.thing->type == MT_BUBBLESHIELD && tm.thing->target->player && tm.thing->target->player->bubbleblowup) || (tm.thing->player && tm.thing->player->bubbleblowup)) - && (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_GACHABOM - || thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG - || thing->type == MT_SSMINE || thing->type == MT_LANDMINE || thing->type == MT_SINK - || thing->type == MT_GARDENTOP - || thing->type == MT_DROPTARGET - || thing->type == MT_KART_LEFTOVER - || (thing->type == MT_PLAYER && tm.thing->target != thing))) { // see if it went over / under if (tm.thing->z > thing->z + thing->height) @@ -1028,7 +1036,18 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) if (tm.thing->z + tm.thing->height < thing->z) return BMIT_CONTINUE; // underneath - return K_BubbleShieldCollide(tm.thing, thing) ? BMIT_CONTINUE : BMIT_ABORT; + if (P_BubbleCanReflect(tm.thing, thing)) + { + // don't let player hitbox touch it too + if (tm.thing->player) + return BMIT_CONTINUE; + return K_BubbleShieldCollide(tm.thing, thing) ? BMIT_CONTINUE : BMIT_ABORT; + } + else if ((thing->flags & MF_SHOOTABLE) && !tm.thing->player) + { + P_DamageMobj(thing, tm.thing, tm.thing->target, 1, DMG_NORMAL); + return BMIT_CONTINUE; + } } // double make sure bubbles won't collide with anything else