]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
we don't use DGA any more, so why -lxxf86dga
[xonotic/darkplaces.git] / sv_phys.c
index b30ec499cdff11375624394f475efa96b8dfb65d..e063526fbcbe26968947ec2c517c6dc634f28221 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -81,19 +81,19 @@ int SV_GenericHitSuperContentsMask(const prvm_edict_t *passedict)
                else if (PRVM_serveredictfloat(passedict, solid) == SOLID_SLIDEBOX)
                {
                        if ((int)PRVM_serveredictfloat(passedict, flags) & FL_MONSTER)
-                               return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_MONSTERCLIP | SUPERCONTENTS_SKY;
+                               return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_MONSTERCLIP;
                        else
-                               return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP | SUPERCONTENTS_SKY;
+                               return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP;
                }
                else if (PRVM_serveredictfloat(passedict, solid) == SOLID_CORPSE)
-                       return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_SKY;
+                       return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY;
                else if (PRVM_serveredictfloat(passedict, solid) == SOLID_TRIGGER)
-                       return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_SKY;
+                       return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY;
                else
-                       return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_CORPSE | SUPERCONTENTS_SKY;
+                       return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_CORPSE;
        }
        else
-               return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_CORPSE | SUPERCONTENTS_SKY;
+               return SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_CORPSE;
 }
 
 /*
@@ -1235,23 +1235,19 @@ static int SV_FlyMove (prvm_edict_t *ent, float time, qboolean applygravity, flo
                return 0;
        gravity = 0;
 
-       if(sv_gameplayfix_nogravityonground.integer)
-               if((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND)
-                       applygravity = false;
-
-       if (applygravity)
+       if(applygravity)
        {
-               if (sv_gameplayfix_gravityunaffectedbyticrate.integer)
-               {
-                       gravity = SV_Gravity(ent) * 0.5f;
-                       PRVM_serveredictvector(ent, velocity)[2] -= gravity;
-               }
-               else
+               gravity = SV_Gravity(ent);
+
+               if(!sv_gameplayfix_nogravityonground.integer || !((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND))
                {
-                       applygravity = false;
-                       PRVM_serveredictvector(ent, velocity)[2] -= SV_Gravity(ent);
+                       if (sv_gameplayfix_gravityunaffectedbyticrate.integer)
+                               PRVM_serveredictvector(ent, velocity)[2] -= gravity * 0.5f;
+                       else
+                               PRVM_serveredictvector(ent, velocity)[2] -= gravity;
                }
        }
+
        blocked = 0;
        VectorCopy(PRVM_serveredictvector(ent, velocity), original_velocity);
        VectorCopy(PRVM_serveredictvector(ent, velocity), primal_velocity);
@@ -1437,8 +1433,16 @@ static int SV_FlyMove (prvm_edict_t *ent, float time, qboolean applygravity, flo
        // LordHavoc: this came from QW and allows you to get out of water more easily
        if (sv_gameplayfix_easierwaterjump.integer && ((int)PRVM_serveredictfloat(ent, flags) & FL_WATERJUMP) && !(blocked & 8))
                VectorCopy(primal_velocity, PRVM_serveredictvector(ent, velocity));
-       if (applygravity && !((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND))
-               PRVM_serveredictvector(ent, velocity)[2] -= gravity;
+
+       if(applygravity)
+       {
+               if(!sv_gameplayfix_nogravityonground.integer || !((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND))
+               {
+                       if (sv_gameplayfix_gravityunaffectedbyticrate.integer)
+                               PRVM_serveredictvector(ent, velocity)[2] -= gravity * 0.5f;
+               }
+       }
+
        return blocked;
 }
 
@@ -1600,7 +1604,6 @@ static qboolean SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, q
        int movetype;
        int type;
        vec3_t mins, maxs;
-       vec3_t original, original_velocity;
        vec3_t start;
        vec3_t end;
 
@@ -1633,8 +1636,7 @@ static qboolean SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, q
 
        VectorCopy(trace->endpos, PRVM_serveredictvector(ent, origin));
 
-       VectorCopy(PRVM_serveredictvector(ent, origin), original);
-       VectorCopy(PRVM_serveredictvector(ent, velocity), original_velocity);
+       ent->priv.required->mark = PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN; // -2: setorigin running
 
        SV_LinkEdict(ent);
 
@@ -1652,7 +1654,21 @@ static qboolean SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, q
        if((PRVM_serveredictfloat(ent, solid) >= SOLID_TRIGGER && trace->ent && (!((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND) || PRVM_serveredictedict(ent, groundentity) != PRVM_EDICT_TO_PROG(trace->ent))))
                SV_Impact (ent, trace);
 
-       return VectorCompare(PRVM_serveredictvector(ent, origin), original);// && VectorCompare(PRVM_serveredictvector(ent, velocity), original_velocity);
+       if(ent->priv.required->mark == PRVM_EDICT_MARK_SETORIGIN_CAUGHT)
+       {
+               ent->priv.required->mark = 0;
+               return false;
+       }
+       else if(ent->priv.required->mark == PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN)
+       {
+               ent->priv.required->mark = 0;
+               return true;
+       }
+       else
+       {
+               Con_Printf("The edict mark had been overwritten! Please debug this.\n");
+               return true;
+       }
 }