From 7b01f7b296202f38a8df72e10aef5b98c4a435ac Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Sep 2010 22:39:27 +0000 Subject: [PATCH] - merged Thing_Destroy extension from Doom64 branch into trunk and extended it by a tid=0, tag!=0 case which will kill all shootable actors in sectors with the specified tag. SVN r2825 (trunk) --- src/actionspecials.h | 2 +- src/p_lnspec.cpp | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/actionspecials.h b/src/actionspecials.h index c735c7a9d..0f31243e0 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -123,7 +123,7 @@ DEFINE_SPECIAL(UsePuzzleItem, 129, 2, 5, 5) DEFINE_SPECIAL(Thing_Activate, 130, 1, 1, 1) DEFINE_SPECIAL(Thing_Deactivate, 131, 1, 1, 1) DEFINE_SPECIAL(Thing_Remove, 132, 1, 1, 1) -DEFINE_SPECIAL(Thing_Destroy, 133, 1, 2, 2) +DEFINE_SPECIAL(Thing_Destroy, 133, 1, 3, 3) DEFINE_SPECIAL(Thing_Projectile, 134, 5, 5, 5) DEFINE_SPECIAL(Thing_Spawn, 135, 3, 4, 4) DEFINE_SPECIAL(Thing_ProjectileGravity, 136, 5, 5, 5) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index a53356a8e..b0697904a 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1210,22 +1210,36 @@ FUNC(LS_Thing_Remove) } FUNC(LS_Thing_Destroy) -// Thing_Destroy (tid, extreme) +// Thing_Destroy (tid, extreme, tag) { - if (arg0 == 0) + AActor *actor; + + if (arg0 == 0 && arg2 == 0) { P_Massacre (); } + else if (arg0 == 0) + { + TThinkerIterator iterator; + + actor = iterator.Next (); + while (actor) + { + AActor *temp = iterator.Next (); + if (actor->flags & MF_SHOOTABLE && actor->Sector->tag == arg2) + P_DamageMobj (actor, NULL, it, arg1 ? TELEFRAG_DAMAGE : actor->health, NAME_None); + actor = temp; + } + } else { FActorIterator iterator (arg0); - AActor *actor; actor = iterator.Next (); while (actor) { AActor *temp = iterator.Next (); - if (actor->flags & MF_SHOOTABLE) + if (actor->flags & MF_SHOOTABLE && (arg2 == 0 || actor->Sector->tag == arg2)) P_DamageMobj (actor, NULL, it, arg1 ? TELEFRAG_DAMAGE : actor->health, NAME_None); actor = temp; }