- changed Sector_SetDamage so that it can explicitly set the damage interval and the leakiness probability, instead of hardcoding it to fixed damage ranges.

- fixed: FCajunMaster::IsDangerous did not check for Heretic's sludge type.
This commit is contained in:
Christoph Oelckers 2016-01-05 15:37:59 +01:00
commit d432df55e9
8 changed files with 82 additions and 32 deletions

View file

@ -2246,7 +2246,7 @@ FUNC(LS_PointPush_SetForce)
}
FUNC(LS_Sector_SetDamage)
// Sector_SetDamage (tag, amount, mod)
// Sector_SetDamage (tag, amount, mod, interval, leaky)
{
// The sector still stores the mod in its old format because
// adding an FName to the sector_t structure might cause
@ -2257,8 +2257,28 @@ FUNC(LS_Sector_SetDamage)
int secnum;
while ((secnum = itr.Next()) >= 0)
{
sectors[secnum].damage = arg1;
sectors[secnum].mod = arg2;
if (arg3 <= 0) // emulate old and hacky method to handle leakiness.
{
if (arg1 < 20)
{
arg4 = 0;
arg3 = 32;
}
else if (arg1 < 50)
{
arg4 = 5;
arg3 = 32;
}
else
{
arg4 = 256;
arg3 = 1;
}
}
sectors[secnum].damageamount = (short)arg1;
sectors[secnum].damagemod = (short)arg2;
sectors[secnum].damageinterval = (short)arg3;
sectors[secnum].leakydamage = (short)arg4;
}
return true;
}