}
// Find e and pick
if(e && pick)
- if(Drag_IsDraggable(e))
+ if(Drag_IsDraggable(e, this))
{
if(ischeat)
IS_CHEAT(this, 0, 0, CHRAME_DRAG);
}
}
-float Drag_IsDraggable(entity draggee)
+float Drag_IsDraggable(entity draggee, entity dragger)
{
// TODO add more checks for bad stuff here
if(draggee == NULL)
if(draggee.classname == "weaponentity")
return false;
- return true;
+ return ((draggee.draggable) ? draggee.draggable(draggee, dragger) : true);
}
float Drag_MayChangeAngles(entity draggee)
dragger.dragentity = NULL;
return false;
}
- if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity))
+ if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity, dragger))
{
Drag_Finish(dragger);
return false;
const float CHRAME_DRAG = 8;
+.bool(entity this, entity dragger) draggable;
void Drag_MoveDrag(entity from, entity to); // call this from CopyBody
void DragBox_Think(entity this);
float Drag(entity this, float force_allow_pick, float ischeat);
void Drag_Begin(entity dragger, entity draggee, vector touchpoint);
void Drag_Finish(entity dragger);
-float Drag_IsDraggable(entity draggee);
+bool Drag_IsDraggable(entity draggee, entity dragger);
float Drag_MayChangeAngles(entity draggee);
void Drag_MoveForward(entity dragger);
void Drag_SetSpeed(entity dragger, float s);