diff --git a/src/p_inter.c b/src/p_inter.c index b5b192885..ebb26aecc 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -392,6 +392,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } } + // Ignore multihits in "ouchie" mode + if (special->flags & (MF_ENEMY | MF_BOSS) && special->flags2 & MF2_FRET) + return; + player = toucher->player; if (player) @@ -399,33 +403,33 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (player->spectator) return; - // Ignore multihits in "ouchie" mode - if (special->flags & (MF_ENEMY | MF_BOSS) && special->flags2 & MF2_FRET) - return; - + // Some hooks may assume that the toucher is a player, so we keep it in here. if (LUA_HookTouchSpecial(special, toucher) || P_MobjWasRemoved(special)) return; } - if (special->type == MT_STEAM && (player || (toucher->flags & MF_PUSHABLE))) + if (player || (toucher->flags & MF_PUSHABLE)) // Special area for objects that are interactable by both player AND MF_PUSHABLE. { - fixed_t speed = special->info->mass; // conveniently, both fans and gas jets use this for the vertical thrust - SINT8 flipval = P_MobjFlip(special); // virtually everything here centers around the thruster's gravity, not the object's! - - if (special->state != &states[S_STEAM1]) // Only when it bursts - return; - - toucher->eflags |= MFE_SPRUNG; - toucher->momz = flipval * FixedMul(speed, FixedSqrt(FixedMul(special->scale, toucher->scale))); // scale the speed with both objects' scales, just like with springs! - - if (player) + if (special->type == MT_STEAM) { - P_ResetPlayer(player); - if (player->panim != PA_FALL) - P_SetMobjState(toucher, S_PLAY_FALL); - } + fixed_t speed = special->info->mass; // conveniently, both fans and gas jets use this for the vertical thrust + SINT8 flipval = P_MobjFlip(special); // virtually everything here centers around the thruster's gravity, not the object's! - return; // Don't collect it! + if (special->state != &states[S_STEAM1]) // Only when it bursts + return; + + toucher->eflags |= MFE_SPRUNG; + toucher->momz = flipval * FixedMul(speed, FixedSqrt(FixedMul(special->scale, toucher->scale))); // scale the speed with both objects' scales, just like with springs! + + if (player) + { + P_ResetPlayer(player); + if (player->panim != PA_FALL) + P_SetMobjState(toucher, S_PLAY_FALL); + } + + return; // Don't collect it! + } } if (!player) // Only players can touch stuff!