]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
fix bug that often made enforcer laser bolts 'stick' in the air if a player is standi...
[xonotic/darkplaces.git] / sv_phys.c
index 11c2ad73c65722e5af4ffc354fa519bc8fcd19da..6b4e1f8e765e7766423d5250aabc7e8a5570b90f 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -374,6 +374,7 @@ int SV_FlyMove (prvm_edict_t *ent, float time, float *stepnormal)
                Con_Print("\n");
 #endif
 
+#if 0
                if (trace.bmodelstartsolid)
                {
                        // LordHavoc: note: this code is what makes entities stick in place
@@ -383,6 +384,7 @@ int SV_FlyMove (prvm_edict_t *ent, float time, float *stepnormal)
                        VectorClear(ent->fields.server->velocity);
                        return 3;
                }
+#endif
 
                // break if it moved the entire distance
                if (trace.fraction == 1)
@@ -571,7 +573,7 @@ SV_PushEntity
 Does not change the entities velocity at all
 ============
 */
-trace_t SV_PushEntity (prvm_edict_t *ent, vec3_t push, qboolean failonstartsolid)
+static trace_t SV_PushEntity (prvm_edict_t *ent, vec3_t push, qboolean failonbmodelstartsolid)
 {
        int type;
        trace_t trace;
@@ -587,7 +589,7 @@ trace_t SV_PushEntity (prvm_edict_t *ent, vec3_t push, qboolean failonstartsolid
                type = MOVE_NORMAL;
 
        trace = SV_Move (ent->fields.server->origin, ent->fields.server->mins, ent->fields.server->maxs, end, type, ent);
-       if (trace.startsolid && failonstartsolid)
+       if (trace.bmodelstartsolid && failonbmodelstartsolid)
                return trace;
 
        VectorCopy (trace.endpos, ent->fields.server->origin);
@@ -773,12 +775,11 @@ void SV_PushMove (prvm_edict_t *pusher, float movetime)
                // FIXME: turn players specially
                check->fields.server->angles[1] += trace.fraction * moveangle[1];
                pusher->fields.server->solid = savesolid; // was SOLID_BSP
-               Con_Printf("%s:%d frac %f startsolid %d bmodelstartsolid %d allsolid %d\n", __FILE__, __LINE__, trace.fraction, trace.startsolid, trace.bmodelstartsolid, trace.allsolid);
+               //Con_Printf("%s:%d frac %f startsolid %d bmodelstartsolid %d allsolid %d\n", __FILE__, __LINE__, trace.fraction, trace.startsolid, trace.bmodelstartsolid, trace.allsolid);
 
                // if it is still inside the pusher, block
                if (SV_ClipMoveToEntity(pusher, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, 0, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY).startsolid)
                {
-                                       Con_Printf("%s:%d\n", __FILE__, __LINE__);
                        // try moving the contacted entity a tiny bit further to account for precision errors
                        vec3_t move2;
                        pusher->fields.server->solid = SOLID_NOT;
@@ -789,7 +790,6 @@ void SV_PushMove (prvm_edict_t *pusher, float movetime)
                        pusher->fields.server->solid = savesolid;
                        if (SV_ClipMoveToEntity(pusher, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, 0, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY).startsolid)
                        {
-                                       Con_Printf("%s:%d\n", __FILE__, __LINE__);
                                // try moving the contacted entity a tiny bit less to account for precision errors
                                pusher->fields.server->solid = SOLID_NOT;
                                VectorScale(move, 0.9, move2);
@@ -799,18 +799,13 @@ void SV_PushMove (prvm_edict_t *pusher, float movetime)
                                pusher->fields.server->solid = savesolid;
                                if (SV_ClipMoveToEntity(pusher, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, 0, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY).startsolid)
                                {
-                                       Con_Printf("%s:%d\n", __FILE__, __LINE__);
                                        // still inside pusher, so it's really blocked
 
                                        // fail the move
                                        if (check->fields.server->mins[0] == check->fields.server->maxs[0])
-                                       {
-                                       Con_Printf("%s:%d\n", __FILE__, __LINE__);
                                                continue;
-                                       }
                                        if (check->fields.server->solid == SOLID_NOT || check->fields.server->solid == SOLID_TRIGGER)
                                        {
-                                       Con_Printf("%s:%d\n", __FILE__, __LINE__);
                                                // corpse
                                                check->fields.server->mins[0] = check->fields.server->mins[1] = 0;
                                                VectorCopy (check->fields.server->mins, check->fields.server->maxs);