- 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)
This commit is contained in:
Christoph Oelckers 2010-09-18 22:39:27 +00:00
commit 7b01f7b296
2 changed files with 19 additions and 5 deletions

View file

@ -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<AActor> 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;
}