this.active = ACTIVE_ACTIVE;
+ this.draggable = drag_undraggable;
+
// damage when blocked
setblocked(this, generic_plat_blocked);
if(this.dmg && (this.message == ""))
precache_sound(this.noise);
this.active = ACTIVE_ACTIVE;
+ this.draggable = drag_undraggable;
this.pos1 = this.origin;
this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
this.angles = '0 0 0';
this.classname = "plat";
+ this.draggable = drag_undraggable;
if (!InitMovingBrushTrigger(this))
return;
this.effects |= EF_LOWPRECISION;
}
}
+bool drag_undraggable(entity draggee, entity dragger)
+{
+ // stuff probably shouldn't need this, we should figure out why they do!
+ // exceptions of course are observers and weapon entities, where things mess up
+ return false;
+}
+
float Drag_IsDraggable(entity draggee, entity dragger)
{
// TODO add more checks for bad stuff here
if(draggee == NULL)
return false;
- if(draggee.classname == "func_bobbing")
- return false;
if(draggee.classname == "door") // FIXME find out why these must be excluded, or work around the problem (trying to drag these causes like 4 fps)
- return false;
- if(draggee.classname == "plat")
- return false;
- if(draggee.classname == "func_button")
- return false;
+ return false; // probably due to BSP collision
// if(draggee.model == "")
// return false;
- if(IS_SPEC(draggee))
- return false;
- if(IS_OBSERVER(draggee))
- return false;
- if(draggee.classname == "exteriorweaponentity")
- return false;
- if(draggee.classname == "weaponentity")
- return false;
return ((draggee.draggable) ? draggee.draggable(draggee, dragger) : true);
}
const float CHRAME_DRAG = 8;
+bool drag_undraggable(entity draggee, entity dragger);
+
.bool(entity this, entity dragger) draggable;
void Drag_MoveDrag(entity from, entity to); // call this from CopyBody
void DragBox_Think(entity this);
this.crouch = false;
STAT(REVIVE_PROGRESS, this) = 0;
this.revival_time = 0;
+ this.draggable = drag_undraggable;
this.items = 0;
STAT(WEAPONS, this) = '0 0 0';
this.event_damage = PlayerDamage;
this.event_heal = PlayerHeal;
+ this.draggable = func_null;
+
if(!this.bot_attack)
IL_PUSH(g_bot_targets, this);
this.bot_attack = true;
setthink(view, CL_Weaponentity_Think);
view.nextthink = time;
view.viewmodelforclient = actor;
+ view.draggable = drag_undraggable;
setcefc(view, CL_Weaponentity_CustomizeEntityForClient);
wepent_link(view);
entity exterior = actor.exteriorweaponentity = new(exteriorweaponentity);
exterior.solid = SOLID_NOT;
exterior.owner = actor;
+ exterior.draggable = drag_undraggable;
exterior.weaponentity_fld = weaponentity;
setorigin(exterior, '0 0 0');
setthink(exterior, CL_ExteriorWeaponentity_Think);