- added new ACS function SetSectorDamage which allows the use of actual damage types, unlike the old Sector_SetDamage. Unlike Sector_SetDamage this function does not use damage amount dependent defaults for the interval and the leakiness if none are passed.

This commit is contained in:
Christoph Oelckers 2016-01-05 16:29:04 +01:00
parent 2b519a92b1
commit d0c372692b
2 changed files with 18 additions and 1 deletions

View file

@ -4458,6 +4458,7 @@ enum EACSFunctions
ACSF_QuakeEx,
ACSF_Warp, // 92
ACSF_GetMaxInventory,
ACSF_SetSectorDamage,
/* Zandronum's - these must be skipped when we reach 99!
-100:ResetMap(0),
@ -5950,6 +5951,23 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
}
break;
case ACSF_SetSectorDamage:
if (argCount >= 2)
{
FSectorTagIterator it(args[0]);
int s;
while ((s = it.Next()) >= 0)
{
sector_t *sec = &sectors[s];
sec->damageamount = args[1];
sec->damagetype = argCount >= 3 ? FName(FBehavior::StaticLookupString(args[2])) : FName(NAME_None);
sec->damageinterval = argCount >= 4 ? clamp(args[3], 1, INT_MAX) : 32;
sec->leakydamage = argCount >= 5 ? args[4] : 0;
}
}
break;
default:
break;
}

View file

@ -1300,7 +1300,6 @@ public:
sec->heightsec = NULL; // sector used to get floor and ceiling height
sec->sectornum = index;
sec->damageinterval = 32;
sec->leakydamage = 5;
if (floordrop) sec->Flags = SECF_FLOORDROP;
// killough 3/7/98: end changes