From a0b830c1989b035b89373eeaf0fcda8c50d7d62b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Feb 2017 15:20:43 +0100 Subject: [PATCH] - allow all actor list CCMDs to filter by tid. --- src/c_cmds.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index ff83d8342d..7e0a66c4b1 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -937,14 +937,20 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha AActor *mo; const PClass *FilterClass = NULL; int counter = 0; + int tid = 0; if (FilterName != NULL) { FilterClass = PClass::FindActor(FilterName); if (FilterClass == NULL) { - Printf("%s is not an actor class.\n", FilterName); - return; + char *endp; + tid = (int)strtol(FilterName, &endp, 10); + if (*endp != 0) + { + Printf("%s is not an actor class.\n", FilterName); + return; + } } } TThinkerIterator it; @@ -953,10 +959,13 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha { if ((FilterClass == NULL || mo->IsA(FilterClass)) && IsActorType(mo)) { - counter++; - if (!countOnly) - Printf ("%s at (%f,%f,%f)\n", - mo->GetClass()->TypeName.GetChars(), mo->X(), mo->Y(), mo->Z()); + if (tid == 0 || tid == mo->tid) + { + counter++; + 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);