mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
player.h: fix ForEachItem()
items iteration
This commit is contained in:
parent
667242fadd
commit
da24c74c20
@ -650,10 +650,11 @@ public:
|
|||||||
auto item = m_rgpPlayerItems[slot];
|
auto item = m_rgpPlayerItems[slot];
|
||||||
while (item)
|
while (item)
|
||||||
{
|
{
|
||||||
|
auto next = item->m_pNext;
|
||||||
if (func(static_cast<T *>(item)))
|
if (func(static_cast<T *>(item)))
|
||||||
return static_cast<T *>(item);
|
return static_cast<T *>(item);
|
||||||
|
|
||||||
item = item->m_pNext;
|
item = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -666,10 +667,11 @@ public:
|
|||||||
{
|
{
|
||||||
while (item)
|
while (item)
|
||||||
{
|
{
|
||||||
|
auto next = item->m_pNext;
|
||||||
if (func(static_cast<T *>(item)))
|
if (func(static_cast<T *>(item)))
|
||||||
return static_cast<T *>(item);
|
return static_cast<T *>(item);
|
||||||
|
|
||||||
item = item->m_pNext;
|
item = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user