SUB_VanishOrRemove(self);
}
-void thrown_wep_ode_think()
-{
- self.nextthink = time;
- if(!self.owner.modelindex)
- remove(self); // the real weapon is gone, remove this
-}
-
// returns amount of ammo used as string, or -1 for failure, or 0 for no ammo count
string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo)
{
wep.nextthink = min(wep.nextthink, time + 0.5);
wep.pickup_anyway = TRUE; // these are ALWAYS pickable
- // make the dropped weapon physical
- /*if(autocvar_physics_ode && autocvar_physics_ode_droppedweapon)
- {
- entity wep2;
- wep2 = spawn();
- setsize(wep2, wep.mins, wep.maxs);
- setorigin(wep2, wep.origin);
- wep2.angles = wep.angles;
- wep2.velocity = velo;
-
- wep2.classname = "droppedweapon2";
- wep2.owner = wep;
- wep2.solid = SOLID_CORPSE;
- wep2.movetype = MOVETYPE_PHYSICS;
- wep2.takedamage = DAMAGE_AIM;
- wep2.damageforcescale = autocvar_physics_ode_droppedweapon_damageforcescale;
-
- wep2.think = thrown_wep_ode_think;
- wep2.nextthink = time;
-
- wep.effects |= EF_NOMODELFLAGS; // disable the spinning
- wep.movetype = MOVETYPE_FOLLOW;
- wep.aiment = wep2;
- }*/
-
return s;
}
}
+void thrown_wep_ode_think()
+{
+ self.nextthink = time;
+ if(!self.owner.modelindex)
+ remove(self); // the real weapon is gone, remove this
+}
+
MUTATOR_HOOKFUNCTION(item_spawning)
{
- dprint("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ if(!autocvar_physics_ode)
+ return FALSE;
+ if(self.classname != "droppedweapon")
+ return FALSE;
+
+ // make the dropped weapon physical
+ entity wep;
+ wep = spawn();
+ setsize(wep, self.mins, self.maxs);
+ setorigin(wep, self.origin);
+ wep.angles = self.angles;
+ wep.velocity = self.velocity;
+
+ wep.classname = "droppedweapon2";
+ wep.owner = self;
+ wep.solid = SOLID_CORPSE;
+ wep.movetype = MOVETYPE_PHYSICS;
+ wep.takedamage = DAMAGE_AIM;
+ wep.damageforcescale = autocvar_g_ode_weapons_damageforcescale;
+
+ wep.think = thrown_wep_ode_think;
+ wep.nextthink = time;
+
+ self.effects |= EF_NOMODELFLAGS; // disable the spinning
+ self.movetype = MOVETYPE_FOLLOW;
+ self.aiment = wep;
- return 0;
+ return FALSE;
}
MUTATOR_DEFINITION(mutator_physical_weapons)
{
MUTATOR_HOOK(Item_Spawn, item_spawning, CBC_ORDER_ANY);
- return 0;
+ return FALSE;
}