- allow all actor list CCMDs to filter by tid.

This commit is contained in:
Christoph Oelckers 2017-02-26 15:20:43 +01:00
parent a6761463af
commit a0b830c198

View file

@ -937,14 +937,20 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha
AActor *mo; AActor *mo;
const PClass *FilterClass = NULL; const PClass *FilterClass = NULL;
int counter = 0; int counter = 0;
int tid = 0;
if (FilterName != NULL) if (FilterName != NULL)
{ {
FilterClass = PClass::FindActor(FilterName); FilterClass = PClass::FindActor(FilterName);
if (FilterClass == NULL) if (FilterClass == NULL)
{ {
Printf("%s is not an actor class.\n", FilterName); char *endp;
return; tid = (int)strtol(FilterName, &endp, 10);
if (*endp != 0)
{
Printf("%s is not an actor class.\n", FilterName);
return;
}
} }
} }
TThinkerIterator<AActor> it; TThinkerIterator<AActor> it;
@ -953,10 +959,13 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha
{ {
if ((FilterClass == NULL || mo->IsA(FilterClass)) && IsActorType(mo)) if ((FilterClass == NULL || mo->IsA(FilterClass)) && IsActorType(mo))
{ {
counter++; if (tid == 0 || tid == mo->tid)
if (!countOnly) {
Printf ("%s at (%f,%f,%f)\n", counter++;
mo->GetClass()->TypeName.GetChars(), mo->X(), mo->Y(), mo->Z()); if (!countOnly)
Printf("%s at (%f,%f,%f)\n",
mo->GetClass()->TypeName.GetChars(), mo->X(), mo->Y(), mo->Z());
}
} }
} }
Printf("%i match(s) found.\n", counter); Printf("%i match(s) found.\n", counter);