diff --git a/defs.qh b/defs.qh index 847b655..5603f75 100644 --- a/defs.qh +++ b/defs.qh @@ -246,6 +246,7 @@ //SB #define TFSTATE_C4THROW 524288 // we're priming the detpack #define TFSTATE_ASSAULTCANNON 1048576 // we're firing an assault cannon +#define TFSTATE_DISARMED 2097152 // We've been disarmed. // Defines used by TF_T_Damage (see combat.qc) diff --git a/jobs.qc b/jobs.qc index 554cb51..2277a2f 100644 --- a/jobs.qc +++ b/jobs.qc @@ -560,6 +560,8 @@ void() JudokaRearm = self.enemy.weaponframe = 0; } + self.owner.tfstate &= ~TFSTATE_DISARMED; + self.think = SUB_Remove; self.nextthink = time + 0.1; }; @@ -624,6 +626,10 @@ void() JobJudoka = trace_ent.current_weapon = WEAP_SNIPER_RIFLE; #endif + trace_ent.tfstate &= ~(TFSTATE_AIMING | TFSTATE_RL_LASER); + + trace_ent.tfstate |= TFSTATE_DISARMED; + //If already reloading, remove that timer te = find(NIL, netname, "reloadtimer"); while (te) diff --git a/tfort.qc b/tfort.qc index 1d07c29..af3e7e0 100644 --- a/tfort.qc +++ b/tfort.qc @@ -1159,7 +1159,17 @@ void() TeamFortress_GrenadePrimed = user = self.owner; - if (!(user.tfstate & TFSTATE_GRENTHROWING) && !user.deadflag) { + local float isdrop = FALSE; + + if (((user.tfstate & TFSTATE_DISARMED) && user.attack_finished > time) || user.deadflag) + isdrop = TRUE; + + local float isthrowing = FALSE; + + if (isdrop || (user.tfstate & TFSTATE_GRENTHROWING)) + isthrowing = TRUE; + + if (!isthrowing) { self.nextthink = time + 0.1; if (!self.think) @@ -1194,7 +1204,7 @@ void() TeamFortress_GrenadePrimed = // set grenade speed makevectors (user.v_angle); - if (user.deadflag) { + if (isdrop) { // if user is dead, throw grenade directly up newmis.velocity = '0 0 200'; } else {