Fix frozen player can throw the weapon in this verified case: place some electro...
authorterencehill <piuntn@gmail.com>
Sat, 15 Jan 2011 19:15:47 +0000 (20:15 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 15 Jan 2011 19:15:47 +0000 (20:15 +0100)
qcsrc/server/mutators/gamemode_freezetag.qc

index d09bbee..4cddbbc 100644 (file)
@@ -326,6 +326,13 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage_Calculate)
     return 1;
 }
 
+MUTATOR_HOOKFUNCTION(freezetag_ForbidThrowCurrentWeapon)
+{
+       if (self.freezetag_frozen)
+               return 1;
+       return 0;
+}
+
 MUTATOR_DEFINITION(gamemode_freezetag)
 {
        MUTATOR_HOOK(MakePlayerObserver, freezetag_RemovePlayer, CBC_ORDER_ANY);
@@ -336,6 +343,7 @@ MUTATOR_DEFINITION(gamemode_freezetag)
        MUTATOR_HOOK(PlayerPreThink, freezetag_PlayerPreThink, CBC_ORDER_FIRST);
        MUTATOR_HOOK(PlayerPhysics, freezetag_PlayerPhysics, CBC_ORDER_FIRST);
        MUTATOR_HOOK(PlayerDamage_Calculate, freezetag_PlayerDamage_Calculate, CBC_ORDER_ANY);
+       MUTATOR_HOOK(ForbidThrowCurrentWeapon, freezetag_ForbidThrowCurrentWeapon, CBC_ORDER_FIRST); //first, last or any? dunno.
 
        MUTATOR_ONADD
        {