mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
- allow all actor list CCMDs to filter by tid.
This commit is contained in:
parent
a6761463af
commit
a0b830c198
1 changed files with 15 additions and 6 deletions
|
@ -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<AActor> 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);
|
||||
|
|
Loading…
Reference in a new issue