Skip to content

Commit f0afa3c

Browse files
committed
Fix undefined behavior in CClientEntity::CallEventNoParent
1 parent b129888 commit f0afa3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Client/mods/deathmatch/logic/CClientEntity.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,8 @@ void CClientEntity::CallEventNoParent(const char* szName, const CLuaArguments& A
791791
// Call it on all our children
792792
if (!m_Children.empty())
793793
{
794-
for (CClientEntity* pEntity : *GetChildrenListSnapshot())
794+
auto pChildrenSnapshot = GetChildrenListSnapshot();
795+
for (CClientEntity* pEntity : *pChildrenSnapshot)
795796
{
796797
if (!pEntity->IsBeingDeleted())
797798
{

0 commit comments

Comments
 (0)