mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 04:01:31 +00:00
Moved Actor TID selector out of header
This commit is contained in:
parent
f5ceaafbbc
commit
de8d839885
2 changed files with 19 additions and 17 deletions
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue