Re-added sector damage for non-players. (#2773)
* Re-add non-player sector damage. Reimplements SECMF_HURTMONSTERS and SECMF_HARMINAIR. * Fixed 3D floor handling for sector damage. Fixes sector damage to either monsters or players not working on (non-)solid 3D floors.
This commit is contained in:
parent
12c6d1361a
commit
34dc204517
14 changed files with 100 additions and 57 deletions
|
|
@ -464,6 +464,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue