diff --git a/src/p_mobj.c b/src/p_mobj.c index e1a1820a..9f4f2429 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1553,6 +1553,7 @@ static void P_PushableCheckBustables(mobj_t *mo) if (node->m_sector->ffloors) { ffloor_t *rover; + fixed_t topheight, bottomheight; for (rover = node->m_sector->ffloors; rover; rover = rover->next) { @@ -1565,37 +1566,39 @@ static void P_PushableCheckBustables(mobj_t *mo) if (!rover->master->frontsector->crumblestate) { + topheight = P_GetFOFTopZ(mo, node->m_sector, rover, mo->x, mo->y, NULL); + bottomheight = P_GetFOFBottomZ(mo, node->m_sector, rover, mo->x, mo->y, NULL); // Height checks if (rover->flags & FF_SHATTERBOTTOM) { - if (mo->z+mo->momz + mo->height < *rover->bottomheight) + if (mo->z+mo->momz + mo->height < bottomheight) continue; - if (mo->z+mo->height > *rover->bottomheight) + if (mo->z+mo->height > bottomheight) continue; } else if (rover->flags & FF_SPINBUST) { - if (mo->z+mo->momz > *rover->topheight) + if (mo->z+mo->momz > topheight) continue; - if (mo->z+mo->height < *rover->bottomheight) + if (mo->z+mo->height < bottomheight) continue; } else if (rover->flags & FF_SHATTER) { - if (mo->z+mo->momz > *rover->topheight) + if (mo->z+mo->momz > topheight) continue; - if (mo->z+mo->momz + mo->height < *rover->bottomheight) + if (mo->z+mo->momz + mo->height < bottomheight) continue; } else { - if (mo->z >= *rover->topheight) + if (mo->z >= topheight) continue; - if (mo->z+mo->height < *rover->bottomheight) + if (mo->z+mo->height < bottomheight) continue; } diff --git a/src/p_user.c b/src/p_user.c index 4d8b6af1..3867137a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1692,6 +1692,7 @@ static void P_CheckBustableBlocks(player_t *player) if (node->m_sector->ffloors) { ffloor_t *rover; + fixed_t topheight, bottomheight; for (rover = node->m_sector->ffloors; rover; rover = rover->next) { @@ -1717,42 +1718,45 @@ static void P_CheckBustableBlocks(player_t *player) if (!(rover->flags & FF_SHATTER) && (rover->flags & FF_ONLYKNUX) && !(player->charability == CA_GLIDEANDCLIMB)) continue; + topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); + bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); + // Height checks if (rover->flags & FF_SHATTERBOTTOM) { - if (player->mo->z+player->mo->momz + player->mo->height < *rover->bottomheight) + if (player->mo->z+player->mo->momz + player->mo->height < bottomheight) continue; - if (player->mo->z+player->mo->height > *rover->bottomheight) + if (player->mo->z+player->mo->height > bottomheight) continue; } else if (rover->flags & FF_SPINBUST) { - if (player->mo->z+player->mo->momz > *rover->topheight) + if (player->mo->z+player->mo->momz > topheight) continue; - if (player->mo->z + player->mo->height < *rover->bottomheight) + if (player->mo->z + player->mo->height < bottomheight) continue; } else if (rover->flags & FF_SHATTER) { - if (player->mo->z + player->mo->momz > *rover->topheight) + if (player->mo->z + player->mo->momz > topheight) continue; - if (player->mo->z+player->mo->momz + player->mo->height < *rover->bottomheight) + if (player->mo->z+player->mo->momz + player->mo->height < bottomheight) continue; } else { - if (player->mo->z >= *rover->topheight) + if (player->mo->z >= topheight) continue; - if (player->mo->z + player->mo->height < *rover->bottomheight) + if (player->mo->z + player->mo->height < bottomheight) continue; } // Impede the player's fall a bit - if (((rover->flags & FF_SPINBUST) || (rover->flags & FF_SHATTER)) && player->mo->z >= *rover->topheight) + if (((rover->flags & FF_SPINBUST) || (rover->flags & FF_SHATTER)) && player->mo->z >= topheight) player->mo->momz >>= 1; else if (rover->flags & FF_SHATTER) {