potential fix for attachment infinite loop crash (#1183)

This commit is contained in:
Quentin E. / iDeath 2023-04-03 23:48:56 +02:00 committed by GitHub
parent a0bc98b59e
commit 042ec19495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -495,10 +495,15 @@ namespace big
if (object == nullptr)
return false;
while (object = g_pointers->m_get_entity_attached_to(object))
constexpr size_t reasonable_limit = 150;
size_t i = 0;
while (object && i < reasonable_limit)
{
if (object->m_net_object && object->m_net_object->m_object_id == attached_to_net_id)
return true;
object = g_pointers->m_get_entity_attached_to(object);
i++;
}
return false;