From: bones_was_here Date: Sun, 2 Apr 2023 20:09:33 +0000 (+1000) Subject: Decide if an item will spawn before precaching its assets X-Git-Tag: xonotic-v0.8.6~137 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=72535eee27a24e051f26e7cbcdbc5fe58386b184;p=xonotic%2Fxonotic-data.pk3dir.git Decide if an item will spawn before precaching its assets May help with #2799 --- diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 9d53f7a28..504ba6e63 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -976,9 +976,6 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default return; } - precache_model(this.model); - precache_sound(this.item_pickupsound); - if (Item_IsLoot(this)) { this.reset = RemoveItem; @@ -1163,6 +1160,10 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default return; } + // we should be sure this item will spawn before loading its assets + precache_model(this.model); + precache_sound(this.item_pickupsound); + setItemGroup(this); }