]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/movetypes/movetypes.qc
Revert "Remove legacy Quake bbox expansion: map entities"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / movetypes / movetypes.qc
index c913970c49416b0b63476032fa84765b11d543d3..651b6f3d642e7f861fe1cb4adcb439b5a7d6a8e3 100644 (file)
@@ -515,11 +515,44 @@ void _Movetype_LinkEdict(entity this, bool touch_triggers)  // SV_LinkEdict
 {
        if(autocvar__movetype_debug)
        {
-               this.absmin = this.origin + this.mins;
-               this.absmax = this.origin + this.maxs;
+               vector mi, ma;
+               if(this.solid == SOLID_BSP)
+               {
+                       // TODO set the absolute bbox
+                       mi = this.mins;
+                       ma = this.maxs;
+               }
+               else
+               {
+                       mi = this.mins;
+                       ma = this.maxs;
+               }
+               mi += this.origin;
+               ma += this.origin;
+
+               if(this.flags & FL_ITEM)
+               {
+                       mi -= '15 15 1';
+                       ma += '15 15 1';
+               }
+               else
+               {
+                       mi -= '1 1 1';
+                       ma += '1 1 1';
+               }
+
+               this.absmin = mi;
+               this.absmax = ma;
        }
        else
+       {
                setorigin(this, this.origin); // calls SV_LinkEdict
+       #ifdef CSQC
+               // NOTE: CSQC's version of setorigin doesn't expand
+               this.absmin -= '1 1 1';
+               this.absmax += '1 1 1';
+       #endif
+       }
 
        if(touch_triggers)
                _Movetype_LinkEdict_TouchAreaGrid(this);