From: Mario <mario.mario@y7mail.com>
Date: Sun, 19 Jan 2020 18:05:44 +0000 (+1000)
Subject: Add a compiler flag to debug shotgun melee range
X-Git-Tag: xonotic-v0.8.5~1161^2~7
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1a749f9f7d0623b782cd5531f76d9c352cf1d9e3;p=xonotic%2Fxonotic-data.pk3dir.git

Add a compiler flag to debug shotgun melee range
---

diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc
index e2f4b640a..b8cae5fd5 100644
--- a/qcsrc/common/weapons/weapon/shotgun.qc
+++ b/qcsrc/common/weapons/weapon/shotgun.qc
@@ -2,6 +2,9 @@
 
 #ifdef SVQC
 
+// enable to debug melee range
+//#define SHOTGUN_MELEEDEBUG
+
 METHOD(Shotgun, m_spawnfunc_hookreplace, Weapon(Shotgun this, entity e))
 {
 	if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
@@ -89,8 +92,10 @@ void W_Shotgun_Melee_Think(entity this)
 		WarpZone_traceline_antilag(this.realowner, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ((IS_CLIENT(this.realowner)) ? ANTILAG_LATENCY(this.realowner) : 0));
 
 		// draw lightning beams for debugging
-		//te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
-		//te_customflash(targpos, 40,  2, '1 1 1');
+	#ifdef SHOTGUN_MELEEDEBUG
+		te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
+		te_customflash(targpos, 40,  2, '1 1 1');
+	#endif
 
 		is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
 
@@ -116,7 +121,9 @@ void W_Shotgun_Melee_Think(entity this)
 			if(accuracy_isgooddamage(this.realowner, target_victim)) { accuracy_add(this.realowner, WEP_SHOTGUN, 0, swing_damage); }
 
 			// draw large red flash for debugging
-			//te_customflash(targpos, 200, 2, '15 0 0');
+		#ifdef SHOTGUN_MELEEDEBUG
+			te_customflash(targpos, 200, 2, '15 0 0');
+		#endif
 
 			if(WEP_CVAR_SEC(shotgun, melee_multihit)) // allow multiple hits with one swing, but not against the same player twice.
 			{