]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use a bad trick to allow nades only in mutators which disallow throwing
authorMario <mario.mario@y7mail.com>
Tue, 11 Jun 2013 05:08:16 +0000 (15:08 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 11 Jun 2013 05:08:16 +0000 (15:08 +1000)
qcsrc/server/mutators/mutator_minstagib.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_nades.qh [new file with mode: 0644]
qcsrc/server/mutators/mutator_riflearena.qc
qcsrc/server/progs.src

index 4a26bdb5fd37665e548b4524baeaa41e344eb088..9b4bd7012f50db0f6f72c9691b5c206106aa1570 100644 (file)
@@ -203,6 +203,7 @@ MUTATOR_HOOKFUNCTION(minstagib_SplitHealthArmor)
 MUTATOR_HOOKFUNCTION(minstagib_ForbidThrowing)
 {
        // weapon dropping on death handled by FilterItem
+       nades_CheckThrow();
 
        return TRUE;
 }
index a7c0fea5116f424ab98e840e305ac55448781fc6..b81451cd0b873807b1666a60b6fd3319085165db 100644 (file)
@@ -260,13 +260,10 @@ float CanThrowNade()
        return TRUE;
 }
 
-MUTATOR_HOOKFUNCTION(nades_ForbidThrowing)
+void nades_CheckThrow()
 {
-       if(!g_weaponarena || !g_minstagib)
-               return FALSE; // TODO: fix this to support all modes that disable weapon dropping
-               
        if(!CanThrowNade())
-               return FALSE;
+               return;
                
        if(!self.nade)
        {
@@ -288,8 +285,6 @@ MUTATOR_HOOKFUNCTION(nades_ForbidThrowing)
                        toss_nade(self, (v_forward * 0.75 + v_up * 0.2 + v_right * 0.05) * _force, 0);
                }
        }
-       
-       return TRUE;
 }
 
 MUTATOR_HOOKFUNCTION(nades_VehicleEnter)
@@ -375,7 +370,6 @@ MUTATOR_HOOKFUNCTION(nades_BuildMutatorsPrettyString)
 
 MUTATOR_DEFINITION(mutator_nades)
 {
-       MUTATOR_HOOK(ForbidThrowCurrentWeapon, nades_ForbidThrowing, CBC_ORDER_ANY);
        MUTATOR_HOOK(VehicleEnter, nades_VehicleEnter, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPreThink, nades_PlayerPreThink, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerSpawn, nades_PlayerSpawn, CBC_ORDER_ANY);
diff --git a/qcsrc/server/mutators/mutator_nades.qh b/qcsrc/server/mutators/mutator_nades.qh
new file mode 100644 (file)
index 0000000..9591b81
--- /dev/null
@@ -0,0 +1 @@
+void() nades_CheckThrow;
\ No newline at end of file
index b1a65f4699b6eba49c8552e82a6f7a7df9ac901b..52077780584be132fb7335b452249b4f9fed8733 100644 (file)
@@ -63,6 +63,7 @@ MUTATOR_HOOKFUNCTION(ra_StartItems)
 
 MUTATOR_HOOKFUNCTION(ra_ForbidThrowCurrentWeapon)
 {
+       nades_CheckThrow();
        return TRUE;
 }
 
index a98580589ec3d0a4567a65149c33cd828d279f65..6894c9909b93247dc0f11603668b35eca70ce9ff 100644 (file)
@@ -45,6 +45,7 @@ mutators/gamemode_keepaway.qh
 mutators/gamemode_nexball.qh 
 mutators/gamemode_lms.qh
 mutators/mutator_dodging.qh
+mutators/mutator_nades.qh
 
 //// tZork Turrets ////
 tturrets/include/turrets_early.qh