]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
properly handle the case that the touch fucntion teleported the player
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 1 Aug 2009 15:20:46 +0000 (15:20 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 1 Aug 2009 15:20:46 +0000 (15:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9080 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index 70bf3477b1d85838407de7c27115b31ba123deba..ef3cb9a5b661c71045c52dfcc435a5bee33bf6d4 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -766,6 +766,7 @@ Returns the clipflags if the velocity was modified (hit something solid)
 1 = floor
 2 = wall / step
 4 = dead stop
+8 = teleported by touch method
 If stepnormal is not NULL, the plane normal of any vertical wall hit will be stored
 ============
 */
@@ -820,6 +821,7 @@ static int SV_FlyMove (prvm_edict_t *ent, float time, qboolean applygravity, flo
                {
                        // we got teleported by a touch function
                        // let's abort the move
+                       blocked |= 8;
                        break;
                }
 
@@ -1004,7 +1006,7 @@ 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)ent->fields.server->flags & FL_WATERJUMP))
+       if (sv_gameplayfix_easierwaterjump.integer && ((int)ent->fields.server->flags & FL_WATERJUMP) && !(blocked & 8))
                VectorCopy(primal_velocity, ent->fields.server->velocity);
        if (applygravity && !((int)ent->fields.server->flags & FL_ONGROUND))
                ent->fields.server->velocity[2] -= gravity;
@@ -1706,11 +1708,8 @@ void SV_WalkMove (prvm_edict_t *ent)
        SV_CheckVelocity(ent);
        SV_LinkEdict (ent, true);
 
-       VectorCopy(ent->fields.server->origin, originalmove_origin);
-       VectorCopy(ent->fields.server->velocity, originalmove_velocity);
-       originalmove_clip = clip;
-       originalmove_flags = (int)ent->fields.server->flags;
-       originalmove_groundentity = ent->fields.server->groundentity;
+       if(clip & 8) // teleport
+               return;
 
        if ((int)ent->fields.server->flags & FL_WATERJUMP)
                return;
@@ -1718,6 +1717,12 @@ void SV_WalkMove (prvm_edict_t *ent)
        if (sv_nostep.integer)
                return;
 
+       VectorCopy(ent->fields.server->origin, originalmove_origin);
+       VectorCopy(ent->fields.server->velocity, originalmove_velocity);
+       originalmove_clip = clip;
+       originalmove_flags = (int)ent->fields.server->flags;
+       originalmove_groundentity = ent->fields.server->groundentity;
+
        // if move didn't block on a step, return
        if (clip & 2)
        {