]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply gravity to items dropped as loot and always precache model/sound
authorMario <mario@smbclan.net>
Sat, 20 Jul 2019 01:27:34 +0000 (11:27 +1000)
committerMario <mario@smbclan.net>
Sat, 20 Jul 2019 01:27:34 +0000 (11:27 +1000)
qcsrc/common/t_items.qc

index 9ea1925495fb16937da5ff8b225568f6ff5aefae..466b38311214c20d0aa66baefa1a7d35fcf93c98 100644 (file)
@@ -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;