Moved Actor TID selector out of header

This commit is contained in:
Boondorl 2024-10-31 13:42:52 -04:00 committed by Ricardo Luís Vaz Silva
parent f5ceaafbbc
commit de8d839885
2 changed files with 19 additions and 17 deletions

View file

@ -2400,6 +2400,24 @@ void FLevelLocals::ApplyCompatibility2()
i_compatflags2 = GetCompatibility2(compatflags2) | ii_compatflags2;
}
AActor* FLevelLocals::SelectActorFromTID(int tid, size_t index, AActor* defactor)
{
if (tid == 0)
return defactor;
AActor* actor = nullptr;
size_t cur = 0u;
auto it = GetActorIterator(tid);
while ((actor = it.Next()) != nullptr)
{
if (cur == index)
return actor;
++cur;
}
return nullptr;
}
//==========================================================================
// IsPointInMap
//

View file

@ -149,6 +149,7 @@ struct FLevelLocals
int GetCompatibility2(int mask);
void ApplyCompatibility();
void ApplyCompatibility2();
AActor* SelectActorFromTID(int tid, size_t index, AActor* defactor);
void Init();
@ -316,23 +317,6 @@ public:
{
return tid == 0 ? defactor : GetActorIterator(tid).Next();
}
AActor* SelectActorFromTID(int tid, size_t index, AActor *defactor)
{
if (tid == 0)
return defactor;
AActor* actor = nullptr;
size_t cur = 0u;
auto it = GetActorIterator(tid);
while ((actor = it.Next()) != nullptr)
{
if (cur == index)
return actor;
++cur;
}
return nullptr;
}
bool SectorHasTags(sector_t *sector)
{