From 69791776a4bbff1cb7cd76951bc3daacc29b657a Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 6 Oct 2015 04:08:29 +0000 Subject: [PATCH] PF_traceline: change Host_Error when a NaN is detected to a Con_Warning. This only affects the case when the developer cvar is set, we already ignore NaN's here. negke reports getting the nan error with this debug progs.dat: http://negke.fov120.com/files/progsbjp.zip (rename to pak0.pak + install as a mod) and his sm133_neg!ke.bsp: https://www.quaddicted.com/reviews/sm133_pack.html (walk over the zombie to activate a lightning trap) git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1255 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/pr_cmds.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Quake/pr_cmds.c b/Quake/pr_cmds.c index 910c9409..bf1c4eed 100644 --- a/Quake/pr_cmds.c +++ b/Quake/pr_cmds.c @@ -685,15 +685,16 @@ static void PF_traceline (void) if (developer.value) { if (IS_NAN(v1[0]) || IS_NAN(v1[1]) || IS_NAN(v1[2]) || IS_NAN(v2[0]) || IS_NAN(v2[1]) || IS_NAN(v2[2])) { - Host_Error("NAN in traceline:\nv1(%f %f %f) v2(%f %f %f)\nentity %d", + Con_Warning ("NAN in traceline:\nv1(%f %f %f) v2(%f %f %f)\nentity %d\n", v1[0], v1[1], v1[2], v2[0], v2[1], v2[2], NUM_FOR_EDICT(ent)); } - } else { - if (IS_NAN(v1[0]) || IS_NAN(v1[1]) || IS_NAN(v1[2])) - v1[0] = v1[1] = v1[2] = 0; - if (IS_NAN(v2[0]) || IS_NAN(v2[1]) || IS_NAN(v2[2])) - v2[0] = v2[1] = v2[2] = 0; } + + if (IS_NAN(v1[0]) || IS_NAN(v1[1]) || IS_NAN(v1[2])) + v1[0] = v1[1] = v1[2] = 0; + if (IS_NAN(v2[0]) || IS_NAN(v2[1]) || IS_NAN(v2[2])) + v2[0] = v2[1] = v2[2] = 0; + trace = SV_Move (v1, vec3_origin, vec3_origin, v2, nomonsters, ent); pr_global_struct->trace_allsolid = trace.allsolid;