From: Mario Date: Sat, 20 Jul 2019 01:27:34 +0000 (+1000) Subject: Apply gravity to items dropped as loot and always precache model/sound X-Git-Tag: xonotic-v0.8.5~1456 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2e6f46f080c1e552ec0aef391755449758b95341;p=xonotic%2Fxonotic-data.pk3dir.git Apply gravity to items dropped as loot and always precache model/sound --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 9ea192549..466b38311 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -1215,6 +1215,9 @@ 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 = SUB_Remove; @@ -1306,9 +1309,6 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default weaponsInMap |= WepSet_FromWeapon(Weapons_from(weaponid)); - precache_model(this.model); - precache_sound(this.item_pickupsound); - if ( def.instanceOfPowerup || def.instanceOfWeaponPickup || (def.instanceOfHealth && def != ITEM_HealthSmall) @@ -1340,12 +1340,13 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default this.ItemStatus |= ITS_ANIMATE2; } + if(Item_IsLoot(this)) + this.gravity = 1; + if(def.instanceOfWeaponPickup) { if (!Item_IsLoot(this)) // if dropped, colormap is already set up nicely this.colormap = 1024; // color shirt=0 pants=0 grey - else - this.gravity = 1; if (!(this.spawnflags & 1024)) this.ItemStatus |= ITS_ANIMATE1; this.SendFlags |= ISF_COLORMAP;