]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/movetypes/movetypes.qc
Properly check against the world when trying for worldstartsolid, fixes some issues...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / movetypes / movetypes.qc
index cbb54cd26e575c8cb6e67740b0b48fa2f02516bf..4539466a24feb9f10d97f6652f3eb31c519af490 100644 (file)
@@ -348,6 +348,10 @@ void _Movetype_LinkEdict_TouchAreaGrid(entity this)  // SV_LinkEdict_TouchAreaGr
                        trace_plane_normal = '0 0 1';
                        trace_plane_dist = 0;
                        trace_ent = this;
+                       trace_dpstartcontents = 0;
+                       trace_dphitcontents = 0;
+                       trace_dphitq3surfaceflags = 0;
+                       trace_dphittexturename = string_null;
 
                        gettouch(it)(it, this);
                }
@@ -505,10 +509,11 @@ bool _Movetype_PushEntity(entity this, vector push, bool failonstartsolid, bool
 {
        _Movetype_PushEntityTrace(this, push);
 
+       // NOTE: this is a workaround for the QC's lack of a worldstartsolid trace parameter
        if(trace_startsolid && failonstartsolid)
        {
                int oldtype = this.move_nomonsters;
-               this.move_nomonsters = MOVE_NOMONSTERS;
+               this.move_nomonsters = MOVE_WORLDONLY;
                _Movetype_PushEntityTrace(this, push);
                this.move_nomonsters = oldtype;
                if(trace_startsolid)
@@ -523,7 +528,7 @@ bool _Movetype_PushEntity(entity this, vector push, bool failonstartsolid, bool
                _Movetype_LinkEdict(this, true);
 
        if(trace_fraction < 1)
-               if(this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || (this.groundentity != trace_ent)))
+               if(this.solid >= SOLID_TRIGGER && trace_ent && (!IS_ONGROUND(this) || (this.groundentity != trace_ent)))
                        _Movetype_Impact(this, trace_ent);
 
        return (this.origin == last_origin); // false if teleported by touch