diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index cc76beaa3..2f81dd6a8 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -41,6 +41,7 @@ #include "w_wad.h" #include "sc_man.h" #include "g_level.h" +#include "p_terrain.h" #include "r_data/colormaps.h" #ifdef _3DFLOORS @@ -341,8 +342,15 @@ void P_PlayerOnSpecial3DFloor(player_t* player) (player->mo->z + player->mo->height) < rover->bottom.plane->ZatPoint(player->mo->x, player->mo->y)) continue; } - - if (rover->model->special || rover->model->damage) P_PlayerInSpecialSector(player, rover->model); + + // Apply sector specials + if (rover->model->special || rover->model->damage) + P_PlayerInSpecialSector(player, rover->model); + + // Apply flat specials (using the ceiling!) + P_PlayerOnSpecialFlat( + player, TerrainTypes[rover->model->GetTexture(sector_t::ceiling)]); + break; } } diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 5f29c3c53..9bc0d4a9b 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -718,12 +718,6 @@ void P_GiveSecret(AActor *actor, bool printmessage, bool playsound, int sectornu void P_PlayerOnSpecialFlat (player_t *player, int floorType) { - if (player->mo->z > player->mo->Sector->floorplane.ZatPoint ( - player->mo->x, player->mo->y) && - !player->mo->waterlevel) - { // Player is not touching the floor - return; - } if (Terrains[floorType].DamageAmount && !(level.time & Terrains[floorType].DamageTimeMask)) { diff --git a/src/p_user.cpp b/src/p_user.cpp index 5f9a69c3a..0617e5d6a 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -2535,7 +2535,13 @@ void P_PlayerThink (player_t *player) { P_PlayerInSpecialSector (player); } - P_PlayerOnSpecialFlat (player, P_GetThingFloorType (player->mo)); + if (player->mo->z <= player->mo->Sector->floorplane.ZatPoint( + player->mo->x, player->mo->y) || + player->mo->waterlevel) + { + // Player must be touching the floor + P_PlayerOnSpecialFlat(player, P_GetThingFloorType(player->mo)); + } if (player->mo->velz <= -player->mo->FallingScreamMinSpeed && player->mo->velz >= -player->mo->FallingScreamMaxSpeed && !player->morphTics && player->mo->waterlevel == 0)