diff --git a/src/playsim/p_enemy.cpp b/src/playsim/p_enemy.cpp index 45df68ac1..1d49f4b3a 100644 --- a/src/playsim/p_enemy.cpp +++ b/src/playsim/p_enemy.cpp @@ -465,6 +465,12 @@ static int P_IsUnderDamage(AActor* actor) dir |= cl->getDirection(); } // Q: consider crushing 3D floors too? + // [inkoalawetrust] Check for sectors that can harm the actor. + if (!(actor->flags9 & MF9_NOSECTORDAMAGE) && seclist->m_sector->damageamount > 0) + { + if (seclist->m_sector->MoreFlags & SECMF_HARMINAIR || actor->isAtZ(seclist->m_sector->LowestFloorAt(actor)) || actor->waterlevel) + return (actor->player || (actor->player == nullptr && seclist->m_sector->MoreFlags & SECMF_HURTMONSTERS)) ? -1 : 0; + } } return dir; } diff --git a/src/playsim/p_spec.cpp b/src/playsim/p_spec.cpp index d72b14e96..3ee5fe871 100644 --- a/src/playsim/p_spec.cpp +++ b/src/playsim/p_spec.cpp @@ -430,10 +430,7 @@ void P_ActorInSpecialSector (AActor *victim, sector_t * sector) // Falling, not all the way down yet? if (!(sector->MoreFlags & SECMF_HARMINAIR) && !victim->isAtZ(sector->LowestFloorAt(victim)) && !victim->waterlevel) - { - DPrintf(2,"P_ActorInSpecialSector(): %p is not touching the floor and HARMINAIR isn't on, so they won't be harmed by the sector.\n",victim); return; - } // Has hit ground.