mirror of
https://github.com/rehlds/reapi.git
synced 2024-12-29 08:05:36 +03:00
player.h: fix ForEachItem()
items iteration
This commit is contained in:
parent
b49bf798ec
commit
37e7b12ba0
@ -383,10 +383,11 @@ public:
|
||||
auto item = m_rgpPlayerItems[ slot ];
|
||||
while (item)
|
||||
{
|
||||
auto next = item->m_pNext;
|
||||
if (func(static_cast<T *>(item)))
|
||||
return static_cast<T *>(item);
|
||||
|
||||
item = item->m_pNext;
|
||||
item = next;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@ -397,10 +398,11 @@ public:
|
||||
{
|
||||
while (item)
|
||||
{
|
||||
auto next = item->m_pNext;
|
||||
if (func(static_cast<T *>(item)))
|
||||
return static_cast<T *>(item);
|
||||
|
||||
item = item->m_pNext;
|
||||
item = next;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user