X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=world.c;h=1c4b74bb1164f292f2dd6cde6cf598f3fa1f2a78;hb=e4b3858e7aca0ead91be1d8f675db084d025abad;hp=ec9942e4d5f23d0b15877a4ee89f6abca378178e;hpb=6a384398c93b7e2bc1936427797909eb60094160;p=xonotic%2Fdarkplaces.git diff --git a/world.c b/world.c index ec9942e4..1c4b74bb 100644 --- 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; @@ -538,7 +538,19 @@ POINT TESTING IN HULLS =============================================================================== */ -// SV_HullPointContents moved to cpu_noasm.c +/* +================== +SV_HullPointContents + +================== +*/ +int SV_HullPointContents (hull_t *hull, int num, vec3_t p) +{ + while (num >= 0) + num = hull->clipnodes[num].children[(hull->planes[hull->clipnodes[num].planenum].type < 3 ? p[hull->planes[hull->clipnodes[num].planenum].type] : DotProduct (hull->planes[hull->clipnodes[num].planenum].normal, p)) < hull->planes[hull->clipnodes[num].planenum].dist]; + + return num; +} /* ============ @@ -748,10 +760,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; @@ -1054,8 +1062,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)