X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Ftuba.qc;h=ae7bbda979a0718cb6bf04ee0f1a119ebf07b589;hp=7b83baa8b52e87c3768abc5290a634198f32f2a9;hb=349aeb508e5a3d577df60bef8a552da2db7d928d;hpb=1542eed6609fb4782c155538d359d414498e7f6e diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 7b83baa8b5..ae7bbda979 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -379,25 +379,25 @@ void W_Tuba_NoteOn(float hittype) self.BUTTON_ATCK2 = 1; } } - METHOD(Tuba, wr_think, void(entity thiswep, entity actor, bool fire1, bool fire2)) + METHOD(Tuba, wr_think, void(entity thiswep, entity actor, int slot, int fire)) { - if(fire1) - if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR(tuba, refire))) + if(fire & 1) + if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR(tuba, refire))) { W_Tuba_NoteOn(0); //weapon_thinkf(actor, WFRAME_FIRE1, autocvar_g_balance_tuba_animtime, w_ready); - weapon_thinkf(actor, WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready); + weapon_thinkf(actor, slot, WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready); } - if(fire2) - if(weapon_prepareattack(thiswep, actor, true, WEP_CVAR(tuba, refire))) + if(fire & 2) + if(weapon_prepareattack(thiswep, actor, slot, true, WEP_CVAR(tuba, refire))) { W_Tuba_NoteOn(HITTYPE_SECONDARY); //weapon_thinkf(actor, WFRAME_FIRE2, autocvar_g_balance_tuba_animtime, w_ready); - weapon_thinkf(actor, WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready); + weapon_thinkf(actor, slot, WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready); } if(actor.tuba_note) { - if(!fire1 && !fire2) + if(!(fire & 1) && !(fire & 2)) { WITH(entity, self, actor.tuba_note, W_Tuba_NoteOff()); } @@ -414,8 +414,9 @@ void W_Tuba_NoteOn(float hittype) } METHOD(Tuba, wr_reload, void(entity thiswep)) { + int slot = 0; // TODO: unhardcode // switch to alternate instruments :) - if(self.weaponentity.state == WS_READY) + if(self.weaponentity[slot].state == WS_READY) { switch(self.tuba_instrument) { @@ -434,8 +435,8 @@ void W_Tuba_NoteOn(float hittype) } W_SetupShot(self, false, 0, "", 0, 0); Send_Effect(EFFECT_TELEPORT, w_shotorg, '0 0 0', 1); - self.weaponentity.state = WS_INUSE; - weapon_thinkf(self, WFRAME_RELOAD, 0.5, w_ready); + self.weaponentity[slot].state = WS_INUSE; + weapon_thinkf(self, slot, WFRAME_RELOAD, 0.5, w_ready); } } METHOD(Tuba, wr_checkammo1, bool(entity thiswep))