f = ((1 - swing) * WEP_CVAR_SEC(shotgun, melee_traces));
// check to see if we can still continue, otherwise give up now
- if((self.realowner.deadflag != DEAD_NO) && WEP_CVAR_SEC(shotgun, melee_no_doubleslap))
+ if(IS_DEAD(self.realowner) && WEP_CVAR_SEC(shotgun, melee_no_doubleslap))
{
remove(self);
return;
METHOD(Shotgun, wr_aim, void(entity thiswep))
{
- if(vlen(self.origin-self.enemy.origin) <= WEP_CVAR_SEC(shotgun, melee_range))
+ if(vdist(self.origin - self.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range)))
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
else
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
{
// don't force reload an empty shotgun if its melee attack is active
if(WEP_CVAR(shotgun, secondary) < 2) {
- thiswep.wr_reload(thiswep);
+ thiswep.wr_reload(thiswep, actor, weaponentity);
}
}
else
METHOD(Shotgun, wr_checkammo2, bool(entity thiswep))
{
if(IS_BOT_CLIENT(self))
- if(vlen(self.origin-self.enemy.origin) > WEP_CVAR_SEC(shotgun, melee_range))
+ if(vdist(self.origin - self.enemy.origin, >, WEP_CVAR_SEC(shotgun, melee_range)))
return false; // bots cannot use secondary out of range (fixes constant melee when out of ammo)
switch(WEP_CVAR(shotgun, secondary))
{
default: return false; // secondary unavailable
}
}
- METHOD(Shotgun, wr_reload, void(entity thiswep))
+ METHOD(Shotgun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
W_Reload(self, WEP_CVAR_PRI(shotgun, ammo), SND(RELOAD)); // WEAPONTODO
}