From: terencehill Date: Sat, 8 Apr 2023 14:35:32 +0000 (+0200) Subject: Optimize IL_REMOVE_RAW. It fixes #2827 (a map with a huge amount of entities crashes... X-Git-Tag: xonotic-v0.8.6~134 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf8037b6949e9af563c628a76d08e27a3528815a;p=xonotic%2Fxonotic-data.pk3dir.git Optimize IL_REMOVE_RAW. It fixes #2827 (a map with a huge amount of entities crashes on start) --- diff --git a/qcsrc/lib/intrusivelist.qh b/qcsrc/lib/intrusivelist.qh index d3a56ba4d..385f7b3b1 100644 --- a/qcsrc/lib/intrusivelist.qh +++ b/qcsrc/lib/intrusivelist.qh @@ -274,9 +274,12 @@ void IL_ENDFRAME() // it should be used only in very particular cases such as after a copyentity call void IL_REMOVE_RAW(entity it) { - it.il_lists = '0 0 0'; - for (int i = 0; i < IL_MAX * 2; ++i) - it.il_links_flds[i] = nil; + if (it.il_lists) + { + it.il_lists = '0 0 0'; + for (int i = 0; i < IL_MAX * 2; ++i) + it.il_links_flds[i] = nil; + } } // called when an entity is deleted with delete() / remove()