]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/items/items.qc
items: apply 0.5s spawnshield to all loot drops by default
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / items / items.qc
index 7c3fd969b5f7f6929a814bdb52500eccb4cdf2e1..3aef870e00a8b775257803ef20ce1270fc941067 100644 (file)
@@ -205,9 +205,6 @@ void Item_Think(entity this)
                if (this.itemdef.instanceOfPowerup)
                        powerups_DropItem_Think(this);
 
-               // enable pickup by the player who threw it
-               this.owner = NULL;
-
                // send slow updates even if the item didn't move
                // recovers prediction desyncs where server thinks item stopped, client thinks it didn't
                ItemUpdate(this);
@@ -1018,6 +1015,9 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                this.nextthink = time + IT_UPDATE_INTERVAL;
                this.wait = time + autocvar_g_items_dropped_lifetime;
 
+               this.owner = NULL; // anyone can pick this up, including the player who threw it
+               this.item_spawnshieldtime = time + 0.5; // but not straight away
+
                this.takedamage = DAMAGE_YES;
                this.event_damage = Item_Damage;
                // enable this to have thrown items burn in lava