From 219b4a4e9fc686687693263800cac4a408a4fa0b Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sun, 4 Dec 2011 21:30:59 +0200 Subject: [PATCH] Use crosshair_trace_plusvisibletriggers instead of trace_ent for dragging, which is the way things should be --- qcsrc/server/cheats.qc | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index c03ea7ae0..c992364e9 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -704,25 +704,27 @@ float CheatFrame() // it goes out of range while slinging it around. float drag; - makevectors(self.v_angle); - WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * autocvar_g_grab_range, MOVE_NORMAL, self); - switch(trace_ent.grab) + crosshair_trace_plusvisibletriggers(self); + if(vlen(self.origin - trace_ent.origin) <= autocvar_g_grab_range) { - case 0: // can't grab - break; - case 1: // owner can grab - if(trace_ent.owner == self || trace_ent.realowner == self) - drag = TRUE; - break; - case 2: // owner and team mates can grab - if(!IsDifferentTeam(trace_ent.owner, self) || !IsDifferentTeam(trace_ent.realowner, self) || trace_ent.team == self.team) + switch(trace_ent.grab) + { + case 0: // can't grab + break; + case 1: // owner can grab + if(trace_ent.owner == self || trace_ent.realowner == self) + drag = TRUE; + break; + case 2: // owner and team mates can grab + if(!IsDifferentTeam(trace_ent.owner, self) || !IsDifferentTeam(trace_ent.realowner, self) || trace_ent.team == self.team) + drag = TRUE; + break; + case 3: // anyone can grab drag = TRUE; - break; - case 3: // anyone can grab - drag = TRUE; - break; - default: - break; + break; + default: + break; + } } Drag(trace_ent, drag, FALSE); // execute dragging } -- 2.39.2