mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 15:32:57 +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,21 +937,29 @@ 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)
|
||||||
|
{
|
||||||
|
char *endp;
|
||||||
|
tid = (int)strtol(FilterName, &endp, 10);
|
||||||
|
if (*endp != 0)
|
||||||
{
|
{
|
||||||
Printf("%s is not an actor class.\n", FilterName);
|
Printf("%s is not an actor class.\n", FilterName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
TThinkerIterator<AActor> it;
|
TThinkerIterator<AActor> it;
|
||||||
|
|
||||||
while ( (mo = it.Next()) )
|
while ( (mo = it.Next()) )
|
||||||
{
|
{
|
||||||
if ((FilterClass == NULL || mo->IsA(FilterClass)) && IsActorType(mo))
|
if ((FilterClass == NULL || mo->IsA(FilterClass)) && IsActorType(mo))
|
||||||
|
{
|
||||||
|
if (tid == 0 || tid == mo->tid)
|
||||||
{
|
{
|
||||||
counter++;
|
counter++;
|
||||||
if (!countOnly)
|
if (!countOnly)
|
||||||
|
@ -959,6 +967,7 @@ static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const cha
|
||||||
mo->GetClass()->TypeName.GetChars(), mo->X(), mo->Y(), mo->Z());
|
mo->GetClass()->TypeName.GetChars(), mo->X(), mo->Y(), mo->Z());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Printf("%i match(s) found.\n", counter);
|
Printf("%i match(s) found.\n", counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue