From b3d2a1f074ffc72bdbb9a27044f7d906caeb268c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 13 Dec 2009 04:59:19 +0000 Subject: [PATCH] - Added a damage type parameter to A_KillChildren, A_KillMaster, and A_KillSiblings. SVN r2023 (trunk) --- docs/rh-log.txt | 4 ++++ src/thingdef/thingdef_codeptr.cpp | 25 +++++++++++++++++-------- wadsrc/static/actors/actor.txt | 6 +++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 57df4f98c0..cd78d4d9d0 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +December 12, 2009 +- Added a damage type parameter to A_KillChildren, A_KillMaster, and + A_KillSiblings. + December 11, 2009 (Changes by Graf Zahl) - fixed: Auto-COMPAT_SHORTTEX for IWADs must be set per IWAD, not in general for Doom. diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index d1c9f40836..441304ea18 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1951,11 +1951,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIf) // A_KillMaster // //=========================================================================== -DEFINE_ACTION_FUNCTION(AActor, A_KillMaster) +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillMaster) { + ACTION_PARAM_START(1); + ACTION_PARAM_NAME(damagetype, 0); + if (self->master != NULL) { - P_DamageMobj(self->master, self, self, self->master->health, NAME_None, DMG_NO_ARMOR); + P_DamageMobj(self->master, self, self, self->master->health, damagetype, DMG_NO_ARMOR); } } @@ -1964,16 +1967,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_KillMaster) // A_KillChildren // //=========================================================================== -DEFINE_ACTION_FUNCTION(AActor, A_KillChildren) +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillChildren) { + ACTION_PARAM_START(1); + ACTION_PARAM_NAME(damagetype, 0); + TThinkerIterator it; - AActor * mo; + AActor *mo; while ( (mo = it.Next()) ) { if (mo->master == self) { - P_DamageMobj(mo, self, self, mo->health, NAME_None, DMG_NO_ARMOR); + P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR); } } } @@ -1983,16 +1989,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_KillChildren) // A_KillSiblings // //=========================================================================== -DEFINE_ACTION_FUNCTION(AActor, A_KillSiblings) +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillSiblings) { + ACTION_PARAM_START(1); + ACTION_PARAM_NAME(damagetype, 0); + TThinkerIterator it; - AActor * mo; + AActor *mo; while ( (mo = it.Next()) ) { if (mo->master == self->master && mo != self) { - P_DamageMobj(mo, self, self, mo->health, NAME_None, DMG_NO_ARMOR); + P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR); } } } diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 51513e10c4..117a29ac81 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -209,9 +209,9 @@ ACTOR Actor native //: Thinker action native A_RemoveMaster(); action native A_RemoveChildren(bool removeall = false); action native A_RemoveSiblings(bool removeall = false); - action native A_KillMaster(); - action native A_KillChildren(); - action native A_KillSiblings(); + action native A_KillMaster(name damagetype = "none"); + action native A_KillChildren(name damagetype = "none"); + action native A_KillSiblings(name damagetype = "none"); action native A_RaiseMaster(); action native A_RaiseChildren(); action native A_RaiseSiblings();