]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Revert "Fix thrown/dropped loot items getting stuck in solid"
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 25 May 2023 06:54:40 +0000 (16:54 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 25 May 2023 06:54:40 +0000 (16:54 +1000)
This reverts commit eff0369f298449514619f34ce0c793bdb960b2b3.

qcsrc/server/items/items.qc

index 0288498df763cc1221585076ee619a79d8cd3b23..ede9cbbaf0f3b5903b4384ddcdd59b2eba485d6d 100644 (file)
@@ -998,13 +998,6 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                return;
        }
 
-       this.mdl = this.model ? this.model : strzone(this.item_model_ent.model_str());
-       setmodel(this, MDL_Null); // precision set below
-
-       // set item size before we spawn a waypoint or droptofloor or MoveOutOfSolid
-       setsize (this, this.pos1 = def.m_mins, this.pos2 = def.m_maxs);
-       this.SendFlags |= ISF_SIZE;
-
        if (Item_IsLoot(this))
        {
                this.reset = RemoveItem;
@@ -1034,11 +1027,6 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                        delete(this);
                        return;
                }
-
-               // most loot items have a bigger horizontal size than a player
-               WarpZoneLib_MoveOutOfSolid(this);
-
-               this.gravity = 1;
        }
        else
        {
@@ -1080,6 +1068,9 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                {
                        // first nudge it off the floor a little bit to avoid math errors
                        setorigin(this, this.origin + '0 0 1');
+                       // set item size before we spawn a spawnfunc_waypoint
+                       setsize(this, def.m_mins, def.m_maxs);
+                       this.SendFlags |= ISF_SIZE;
                        // note droptofloor returns false if stuck/or would fall too far
                        if (!this.noalign)
                                droptofloor(this);
@@ -1128,21 +1119,25 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                }
 
                Item_ItemsTime_SetTime(this, 0);
-
-               this.glowmod = def.m_color;
        }
 
        this.bot_pickup = true;
        this.bot_pickupevalfunc = pickupevalfunc;
        this.bot_pickupbasevalue = pickupbasevalue;
+       this.mdl = this.model ? this.model : strzone(this.item_model_ent.model_str());
        this.netname = itemname;
        settouch(this, Item_Touch);
+       setmodel(this, MDL_Null); // precision set below
        //this.effects |= EF_LOWPRECISION;
 
        // support skinned models for powerups
        if(!this.skin)
                this.skin = def.m_skin;
 
+       setsize (this, this.pos1 =  def.m_mins, this.pos2 = def.m_maxs);
+
+       this.SendFlags |= ISF_SIZE;
+
        if (!(this.spawnflags & 1024)) {
                if(def.instanceOfPowerup)
                        this.ItemStatus |= ITS_ANIMATE1;
@@ -1151,6 +1146,11 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                        this.ItemStatus |= ITS_ANIMATE2;
        }
 
+       if(Item_IsLoot(this))
+               this.gravity = 1;
+       else
+               this.glowmod = def.m_color;
+
        if(def.instanceOfWeaponPickup)
        {
                if (!Item_IsLoot(this)) // if dropped, colormap is already set up nicely