if(!w.wr_checkammo1(w))
{
self.cnt = WEP_MINE_LAYER.m_id;
- ATTACK_FINISHED(self) = time;
+ int slot = 0; // TODO: unhardcode
+ ATTACK_FINISHED(self, slot) = time;
self.switchweapon = w_getbestweapon(self);
}
setself(this);
if(!w.wr_checkammo1(w))
{
self.cnt = WEP_MINE_LAYER.m_id;
- ATTACK_FINISHED(self) = time;
+ int slot = 0; // TODO: unhardcode
+ ATTACK_FINISHED(self, slot) = time;
self.switchweapon = w_getbestweapon(self);
}
setself(this);
if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
}
- METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, bool fire1, bool fire2))
+ METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_minelayer_reload_ammo && actor.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
{
w.wr_reload(w);
}
}
- else if(fire1)
+ else if(fire & 1)
{
- if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR(minelayer, refire)))
+ if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR(minelayer, refire)))
{
W_MineLayer_Attack(thiswep);
- weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR(minelayer, animtime), w_ready);
+ weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR(minelayer, animtime), w_ready);
}
}
- if(fire2)
+ if(fire & 2)
{
if(W_MineLayer_PlacedMines(true))
sound(actor, CH_WEAPON_B, SND_MINE_DET, VOL_BASE, ATTN_NORM);
}
METHOD(MineLayer, wr_checkammo1, bool(entity thiswep))
{
+ int slot = 0; // TODO: unhardcode
// don't switch while placing a mine
- if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER.m_id)
+ if(ATTACK_FINISHED(self, slot) <= time || self.weapon != WEP_MINE_LAYER.m_id)
{
float ammo_amount = self.WEP_AMMO(MINE_LAYER) >= WEP_CVAR(minelayer, ammo);
ammo_amount += self.(weapon_load[WEP_MINE_LAYER.m_id]) >= WEP_CVAR(minelayer, ammo);