END_CHEAT_FUNCTION();
}
-void crosshair_trace_plusvisibletriggers(entity pl);
-float Drag();
+float Drag(entity e);
void Drag_Begin(entity dragger, entity draggee, vector touchpoint);
void Drag_Finish(entity dragger);
float Drag_IsDraggable(entity draggee);
default:
if(self.BUTTON_DRAG)
IS_CHEAT(0, 0, CHRAME_DRAG);
- if(Drag())
+ crosshair_trace_plusvisibletriggers(self);
+ if(Drag(trace_ent))
DID_CHEAT();
break;
}
// ENTITY DRAGGING
-void crosshair_trace_plusvisibletriggers(entity pl)
-{
- entity first;
- entity e;
- first = findchainfloat(solid, SOLID_TRIGGER);
-
- for (e = first; e; e = e.chain)
- if (e.model != "")
- e.solid = SOLID_BSP;
-
- crosshair_trace(pl);
-
- for (e = first; e; e = e.chain)
- e.solid = SOLID_TRIGGER;
-}
-
-float Drag()
+float Drag(entity e)
{
if(Drag_IsDragging(self))
{
if(self.BUTTON_DRAG)
{
crosshair_trace_plusvisibletriggers(self);
- if(trace_ent)
- if(Drag_IsDraggable(trace_ent))
+ if(e)
+ if(Drag_IsDraggable(e))
{
- if(trace_ent.draggedby)
- Drag_Finish(trace_ent.draggedby);
- if(trace_ent.tag_entity)
- detach_sameorigin(trace_ent);
- Drag_Begin(self, trace_ent, trace_endpos);
+ if(e.draggedby)
+ Drag_Finish(e.draggedby);
+ if(e.tag_entity)
+ detach_sameorigin(e);
+ Drag_Begin(self, e, trace_endpos);
return TRUE;
}
}
{
traceline_antilag(pl, pl.cursor_trace_start, pl.cursor_trace_start + normalize(pl.cursor_trace_endpos - pl.cursor_trace_start) * MAX_SHOT_DISTANCE, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl));
}
+void crosshair_trace_plusvisibletriggers(entity pl)
+{
+ entity first;
+ entity e;
+ first = findchainfloat(solid, SOLID_TRIGGER);
+
+ for (e = first; e; e = e.chain)
+ if (e.model != "")
+ e.solid = SOLID_BSP;
+
+ crosshair_trace(pl);
+
+ for (e = first; e; e = e.chain)
+ e.solid = SOLID_TRIGGER;
+}
void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
void WarpZone_crosshair_trace(entity pl)
{