From: Rudolf Polzer Date: Fri, 25 Jun 2010 11:00:57 +0000 (+0200) Subject: fix endless loops in Nex shots through recursive warpzones X-Git-Tag: xonotic-v0.1.0preview~520 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=ce6e50e11b71814a12aae0ef1800e550fa6a73c2 fix endless loops in Nex shots through recursive warpzones --- 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;