From ce6e50e11b71814a12aae0ef1800e550fa6a73c2 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 25 Jun 2010 13:00:57 +0200 Subject: [PATCH] fix endless loops in Nex shots through recursive warpzones --- qcsrc/server/w_common.qc | 2 +- qcsrc/warpzonelib/common.qc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/w_common.qc b/qcsrc/server/w_common.qc index 8f2de4e8ce..4427320586 100644 --- a/qcsrc/server/w_common.qc +++ b/qcsrc/server/w_common.qc @@ -270,7 +270,7 @@ float W_BallisticBullet_LeaveSolid(entity e, vector vel, float constant) self.W_BallisticBullet_LeaveSolid_origin = trace_endpos; - dst = vlen(trace_endpos - self.origin); + dst = max(cvar("g_ballistics_mindistance"), vlen(trace_endpos - self.origin)); // E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass Es_m = E0_m - constant * dst; if(Es_m <= 0) diff --git a/qcsrc/warpzonelib/common.qc b/qcsrc/warpzonelib/common.qc index e4acfb1693..5cf155642b 100644 --- a/qcsrc/warpzonelib/common.qc +++ b/qcsrc/warpzonelib/common.qc @@ -200,6 +200,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, if(--i < 1) { dprint("Too many warpzones in sequence, aborting trace.\n"); + trace_ent = world; break; } tracebox(org, mi, ma, end, nomonsters, forent); @@ -216,6 +217,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, if(trace_ent == wz) { dprint("I transformed into the same zone again, wtf, aborting the trace\n"); + trace_ent = world; break; } wz = trace_ent; @@ -281,6 +283,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo if(--i < 1) { dprint("Too many warpzones in sequence, aborting trace.\n"); + trace_ent = world; break; } tracetoss(e, forent); @@ -297,6 +300,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo if(trace_ent == wz) { dprint("I transformed into the same zone again, wtf, aborting the trace\n"); + trace_ent = world; break; } wz = trace_ent; -- 2.39.2