]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
Only one player list is displayed now. Moved it a little bit down so if you set con_n...
[xonotic/darkplaces.git] / sv_phys.c
index 4de751be5a4f4155a3cb1ac3a510dc1decece52d..7189b842eaa286801c367cf951d94d983bcf68a1 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -547,6 +547,12 @@ void SV_PushMove (edict_t *pusher, float movetime)
        int num_moved;
        model_t *pushermodel;
 
+       if (!pusher->v->velocity[0] && !pusher->v->velocity[1] && !pusher->v->velocity[2] && !pusher->v->avelocity[0] && !pusher->v->avelocity[1] && !pusher->v->avelocity[2])
+       {
+               pusher->v->ltime += movetime;
+               return;
+       }
+
        switch ((int) pusher->v->solid)
        {
        // LordHavoc: valid pusher types
@@ -560,17 +566,15 @@ void SV_PushMove (edict_t *pusher, float movetime)
        case SOLID_TRIGGER:
                VectorMA (pusher->v->origin, movetime, pusher->v->velocity, pusher->v->origin);
                VectorMA (pusher->v->angles, movetime, pusher->v->avelocity, pusher->v->angles);
+               pusher->v->angles[0] -= 360.0 * floor(pusher->v->angles[0] * (1.0 / 360.0));
+               pusher->v->angles[1] -= 360.0 * floor(pusher->v->angles[1] * (1.0 / 360.0));
+               pusher->v->angles[2] -= 360.0 * floor(pusher->v->angles[2] * (1.0 / 360.0));
                pusher->v->ltime += movetime;
                SV_LinkEdict (pusher, false);
                return;
        default:
                Host_Error("SV_PushMove: unrecognized solid type %f\n", pusher->v->solid);
        }
-       if (!pusher->v->velocity[0] && !pusher->v->velocity[1] && !pusher->v->velocity[2] && !pusher->v->avelocity[0] && !pusher->v->avelocity[1] && !pusher->v->avelocity[2])
-       {
-               pusher->v->ltime += movetime;
-               return;
-       }
        index = (int) pusher->v->modelindex;
        if (index < 1 || index >= MAX_MODELS)
                Host_Error("SV_PushMove: invalid modelindex %f\n", pusher->v->modelindex);
@@ -741,10 +745,13 @@ void SV_PushMove (edict_t *pusher, float movetime)
                                        pr_global_struct->other = EDICT_TO_PROG(check);
                                        PR_ExecuteProgram (pusher->v->blocked, "");
                                }
-                               return;
+                               break;
                        }
                }
        }
+       pusher->v->angles[0] -= 360.0 * floor(pusher->v->angles[0] * (1.0 / 360.0));
+       pusher->v->angles[1] -= 360.0 * floor(pusher->v->angles[1] * (1.0 / 360.0));
+       pusher->v->angles[2] -= 360.0 * floor(pusher->v->angles[2] * (1.0 / 360.0));
 }
 
 /*
@@ -955,7 +962,7 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
 
        // still not moving
        VectorClear (ent->v->velocity);
-       Con_Printf("TryUnstick - failure.\n");
+       Con_DPrintf("TryUnstick - failure.\n");
        return 7;
 }
 
@@ -1277,7 +1284,7 @@ void SV_Physics_Step (edict_t *ent)
                SV_AddGravity(ent);
                SV_CheckVelocity(ent);
                SV_FlyMove(ent, sv.frametime, NULL);
-               SV_LinkEdict(ent, false);
+               SV_LinkEdict(ent, true);
 
                // just hit ground
                if (hitsound && (int)ent->v->flags & FL_ONGROUND)
@@ -1369,7 +1376,9 @@ void SV_Physics (void)
                                        SV_AddGravity (ent);
                                SV_CheckStuck (ent);
                                SV_WalkMove (ent);
-                               SV_LinkEdict (ent, true);
+                               // relink normal entities here, players always get relinked so don't relink twice
+                               if (!(i > 0 && i <= svs.maxclients))
+                                       SV_LinkEdict (ent, true);
                        }
                        break;
                case MOVETYPE_TOSS: