]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move nades throw check into the nades mutator
authorMario <mario.mario@y7mail.com>
Mon, 7 Oct 2013 23:54:42 +0000 (16:54 -0700)
committerMario <mario.mario@y7mail.com>
Mon, 7 Oct 2013 23:54:42 +0000 (16:54 -0700)
qcsrc/server/mutators/mutator_minstagib.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_overkill.qc

index 0d90ea36219510db62e2ff2308d4bd6fff283054..12888fd4dc7d9f5d1cfa18373fe0eec536cd87a6 100644 (file)
@@ -203,7 +203,6 @@ MUTATOR_HOOKFUNCTION(minstagib_SplitHealthArmor)
 MUTATOR_HOOKFUNCTION(minstagib_ForbidThrowing)
 {
        // weapon dropping on death handled by FilterItem
-       nades_CheckThrow();
 
        return TRUE;
 }
index d911720de536c00407b85d83ee2de43b382c54a8..42b2b167b12fe10ca71f2e13eb244591ead82d8d 100644 (file)
@@ -286,6 +286,12 @@ void nades_CheckThrow()
        }
 }
 
+MUTATOR_HOOKFUNCTION(nades_CheckThrow)
+{
+       if(MUTATOR_RETURNVALUE) { nades_CheckThrow(); }
+       return FALSE;
+}
+
 MUTATOR_HOOKFUNCTION(nades_VehicleEnter)
 {
        if(other.nade)
@@ -369,6 +375,7 @@ MUTATOR_HOOKFUNCTION(nades_BuildMutatorsPrettyString)
 
 MUTATOR_DEFINITION(mutator_nades)
 {
+       MUTATOR_HOOK(ForbidThrowCurrentWeapon, nades_CheckThrow, CBC_ORDER_LAST);
        MUTATOR_HOOK(VehicleEnter, nades_VehicleEnter, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPreThink, nades_PlayerPreThink, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerSpawn, nades_PlayerSpawn, CBC_ORDER_ANY);
index 713866d97af123850d2a4d42956fa6a6290469b3..e2b1fb92d8e36938f27773d71b26026b606bb63a 100644 (file)
@@ -104,8 +104,6 @@ MUTATOR_HOOKFUNCTION(ok_PlayerDies)
 
 MUTATOR_HOOKFUNCTION(ok_ForbidThrowCurrentWeapon)
 {
-       nades_CheckThrow();
-
        return TRUE;
 }