From 210c1eebebf635b57283bc66e2c0cc21d6ac3520 Mon Sep 17 00:00:00 2001 From: Martin Taibr Date: Sat, 24 Dec 2016 03:43:54 +0100 Subject: [PATCH] warning in case something is wrong with max_shot_distance --- qcsrc/server/weapons/tracing.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index fd78c9120..b85013d9c 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -399,9 +399,12 @@ void fireBullet(entity this, vector start, vector dir, float spread, float max_s start = trace_endpos; entity hit = trace_ent; - // traced up to max_shot_distance and didn't hit anything at all if (trace_fraction == 1.0) + { + // should not happen if max_shot_distance is correctly determined by map size + LOG_WARN("traced up to max_shot_distance and didn't hit anything at all"); break; + } // When hitting sky, stop. if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY) -- 2.39.2