mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 00:21:43 +00:00
- when a damaging sector's damage interval is 0, instantly kill the player instead of dividing by 0
This commit is contained in:
parent
ece526a99c
commit
90895d154b
1 changed files with 8 additions and 2 deletions
|
@ -452,9 +452,15 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector)
|
|||
player->hazardtype = sector->damagetype;
|
||||
player->hazardinterval = sector->damageinterval;
|
||||
}
|
||||
else if (Level->time % sector->damageinterval == 0)
|
||||
else if ((sector->damageinterval == 0) || (Level->time % sector->damageinterval == 0))
|
||||
{
|
||||
if (!(player->cheats & (CF_GODMODE|CF_GODMODE2))) P_DamageMobj(player->mo, NULL, NULL, sector->damageamount, sector->damagetype);
|
||||
if (!(player->cheats & (CF_GODMODE | CF_GODMODE2)))
|
||||
{
|
||||
if (sector->damageinterval == 0 && sector->damageamount > 0) // level designer seems to be a bit of a sadist, we're going to just instantly kill the player if damageamount is above 0.
|
||||
P_DamageMobj(player->mo, NULL, NULL, TELEFRAG_DAMAGE, sector->damagetype);
|
||||
else
|
||||
P_DamageMobj(player->mo, NULL, NULL, sector->damageamount, sector->damagetype);
|
||||
}
|
||||
if ((sector->Flags & SECF_ENDLEVEL) && player->health <= 10 && (!deathmatch || !(dmflags & DF_NO_EXIT)))
|
||||
{
|
||||
Level->ExitLevel(0, false);
|
||||
|
|
Loading…
Reference in a new issue