]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Survival: Defenders no longer can throw weapons.
authorLyberta <lyberta@lyberta.net>
Sat, 25 Mar 2017 09:31:11 +0000 (12:31 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 25 Mar 2017 09:31:11 +0000 (12:31 +0300)
qcsrc/server/mutators/mutator/gamemode_survival.qc

index 39a8f4a8da263fc0cda42bfc82abd2a5e8dd4dbc..3af8de59ca138890636e8fcd3509fb8e0346866e 100644 (file)
@@ -1866,6 +1866,16 @@ MUTATOR_HOOKFUNCTION(surv, ItemTouch)
        return MUT_ITEMTOUCH_CONTINUE;
 }
 
+/// \brief Hook which is called when the player tries to throw their weapon.
+MUTATOR_HOOKFUNCTION(surv, ForbidThrowCurrentWeapon)
+{
+       entity player = M_ARGV(0, entity);
+       if (player.team == surv_defenderteam)
+       {
+               return true;
+       }
+}
+
 /// \brief Hook which is called when the damage amount must be determined.
 MUTATOR_HOOKFUNCTION(surv, Damage_Calculate)
 {