From d0c372692bd6388b699da253a4f9eb93c7f90fdf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 5 Jan 2016 16:29:04 +0100 Subject: [PATCH] - 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. --- src/p_acs.cpp | 18 ++++++++++++++++++ src/p_udmf.cpp | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 663d316dcb..aacd5cc4a5 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -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 = §ors[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; } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 89c039aefd..2169da49fa 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -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