]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Q1BSP: improve droptofloor compatibility with Quake progs
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 6 Aug 2024 10:19:40 +0000 (20:19 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 6 Aug 2024 10:20:20 +0000 (20:20 +1000)
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
qcsrc/server/world.qc

index effc4d51d407b28b783cae9f0dcbb8e3cbc30a36..930a3040cf008e1562958bf2ad6f4c3a2888d8ac 100644 (file)
@@ -2391,6 +2391,13 @@ void DropToFloor_QC(entity this)
                else if (nudgeresult > 0)
                        LOG_WARNF("DropToFloor_QC at \"%v\": FIXED badly placed entity \"%s\" before drop", this.origin, this.classname);
        }
+       else if (!autocvar_sv_mapformat_is_quake3 && !autocvar_sv_mapformat_is_quake2) // Quake
+       {
+               if (this.flags & FL_ITEM)
+                       this.origin.z += 6;
+               else
+                       this.origin.z += 1; // monsters 1, misc_explobox 2 but we don't support those currently
+       }
 
        vector end = this.origin;
        if (autocvar_sv_mapformat_is_quake3)
@@ -2403,10 +2410,15 @@ void DropToFloor_QC(entity this)
 
        if (!autocvar_sv_mapformat_is_quake3 && !autocvar_sv_mapformat_is_quake2 && (trace_allsolid || trace_fraction == 1)) // Quake
        {
-               // Quake games just delete badly placed entities...
-               LOG_WARNF("DropToFloor_QC at \"%v\" (Quake compat): DELETING badly placed entity \"%s\"", this.origin, this.classname);
-               delete(this);
-               return;
+               // Quake games just delete badly placed items (and misc_explobox)...
+               if (this.flags & FL_ITEM)
+               {
+                       LOG_WARNF("DropToFloor_QC at \"%v\" (Quake compat): DELETING badly placed item \"%s\"", this.origin, this.classname);
+                       delete(this);
+                       return;
+               }
+               // ...not monsters though...
+               LOG_WARNF("DropToFloor_QC at \"%v\" (Quake compat): badly placed entity \"%s\"", this.origin, this.classname);
        }
        else if ((Q3COMPAT_COMMON || autocvar_sv_mapformat_is_quake2) && trace_startsolid) // Q3, Q2
        {