]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - world.c
Coordinates are now floats in network protocol (bloats it yes, but the accuracy allow...
[xonotic/darkplaces.git] / world.c
diff --git a/world.c b/world.c
index a37612bf146b35f387955b2e87db89833e1c8fc4..eea796c7c0453539584d31f03ab6b608bd675858 100644 (file)
--- a/world.c
+++ b/world.c
@@ -325,7 +325,7 @@ loc0:
                pr_global_struct->self = EDICT_TO_PROG(touch);
                pr_global_struct->other = EDICT_TO_PROG(ent);
                pr_global_struct->time = sv.time;
-               PR_ExecuteProgram (touch->v.touch);
+               PR_ExecuteProgram (touch->v.touch, "");
 
                pr_global_struct->self = old_self;
                pr_global_struct->other = old_other;
@@ -692,11 +692,7 @@ loc0:
        }
        else
        {
-               // LordHavoc: unrolled vector operation because the compiler can't be sure vec3_origin is 0
-//             VectorSubtract (vec3_origin, plane->normal, trace->plane.normal);
-               trace->plane.normal[0] = -plane->normal[0];
-               trace->plane.normal[1] = -plane->normal[1];
-               trace->plane.normal[2] = -plane->normal[2];
+               VectorNegate (plane->normal, trace->plane.normal);
                trace->plane.dist = -plane->dist;
        }
 
@@ -752,10 +748,6 @@ loc0:
                return true;            // empty
        }
 
-       // LordHavoc: this can be eliminated by validating in the loader...  but Mercury told me not to bother
-       if (num < hull->firstclipnode || num > hull->lastclipnode)
-               Sys_Error ("SV_RecursiveHullCheck: bad node number");
-
 // find the point distances
        node = hull->clipnodes + num;
        plane = hull->planes + node->planenum;
@@ -824,11 +816,7 @@ loc0:
        }
        else
        {
-               // LordHavoc: vec3_origin is evil; the compiler can not rely on it being '0 0 0'
-//             VectorSubtract (vec3_origin, plane->normal, trace->plane.normal);
-               trace->plane.normal[0] = -plane->normal[0];
-               trace->plane.normal[1] = -plane->normal[1];
-               trace->plane.normal[2] = -plane->normal[2];
+               VectorNegate (plane->normal, trace->plane.normal);
                trace->plane.dist = -plane->dist;
        }
 
@@ -974,7 +962,7 @@ trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t max
 
                if (trace.fraction != 1)
                {
-                       VectorSubtract (vec3_origin, ent->v.angles, a);
+                       VectorNegate (ent->v.angles, a);
                        AngleVectors (a, forward, right, up);
 
                        VectorCopy (trace.endpos, temp);
@@ -1062,8 +1050,7 @@ loc0:
                        trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins2, clip->maxs2, clip->end);
                else
                        trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins, clip->maxs, clip->end);
-               if (trace.allsolid || trace.startsolid ||
-               trace.fraction < clip->trace.fraction)
+               if (trace.allsolid || trace.startsolid || trace.fraction < clip->trace.fraction)
                {
                        trace.ent = touch;
                        if (clip->trace.startsolid)