From: Samual Date: Fri, 30 Sep 2011 20:00:18 +0000 (-0400) Subject: Fix a bug with shotgun secondary where it would give up the swing before it actually... X-Git-Tag: xonotic-v0.6.0~40^2~92^2~1^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b8ecdf1fe54d2ce45a34eb2d8d6df5fe67967f49;p=xonotic%2Fxonotic-data.pk3dir.git Fix a bug with shotgun secondary where it would give up the swing before it actually finished tracing - Also start working on hook effects --- diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 4971fa3aa..e27dcaa67 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -216,6 +216,7 @@ void Draw_GrapplingHook() void Remove_GrapplingHook() { sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); + print("hook was removed at ", vtos(self.origin), "\n"); } void Ent_ReadHook(float bIsNew, float type) diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index f84f22e8b..58ac58f08 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -60,11 +60,11 @@ void shotgun_meleethink (void) // calculate swing percentage based on time meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor(); - swing = bound(0, (self.cnt + meleetime - time) / meleetime, 1); + swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10); f = ((1 - swing) * autocvar_g_balance_shotgun_secondary_melee_traces); // check to see if we can still continue, otherwise give up now - if(time >= self.cnt + meleetime || (self.realowner.deadflag != DEAD_NO && autocvar_g_balance_shotgun_secondary_melee_no_doubleslap)) + if((self.realowner.deadflag != DEAD_NO) && autocvar_g_balance_shotgun_secondary_melee_no_doubleslap) { remove(self); return; @@ -122,9 +122,18 @@ void shotgun_meleethink (void) } } - // set up next frame - self.swing_prev = i; - self.nextthink = time; + if(time >= self.cnt + meleetime) + { + // melee is finished + remove(self); + return; + } + else + { + // set up next frame + self.swing_prev = i; + self.nextthink = time; + } } void W_Shotgun_Attack2 (void)