]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disable weapon dropping in melee only mutator
authorMario <mario.mario@y7mail.com>
Mon, 20 Jan 2014 04:14:47 +0000 (15:14 +1100)
committerMario <mario.mario@y7mail.com>
Mon, 20 Jan 2014 04:14:47 +0000 (15:14 +1100)
qcsrc/server/mutators/mutator_melee_only.qc

index 73b7dd949939c691173ebf0b683dfd451f72238b..c435aba0342c64e9c9fb3e238f2d5982772725d6 100644 (file)
@@ -1,14 +1,16 @@
 MUTATOR_HOOKFUNCTION(melee_SetStartItems)
 {
-       start_ammo_shells = 0;
-       warmup_start_ammo_shells = 0;
-
-       start_weapons = WEPSET_SHOTGUN;
-       warmup_start_weapons = WEPSET_SHOTGUN;
+       start_ammo_shells = warmup_start_ammo_shells = 0;
+       start_weapons = warmup_start_weapons = WEPSET_SHOTGUN;
 
        return FALSE;
 }
 
+MUTATOR_HOOKFUNCTION(melee_ForbidThrowing)
+{
+       return TRUE;
+}
+
 MUTATOR_HOOKFUNCTION(melee_FilterItem)
 {
        switch (self.items)
@@ -36,6 +38,7 @@ MUTATOR_HOOKFUNCTION(melee_BuildMutatorsPrettyString)
 MUTATOR_DEFINITION(mutator_melee_only)
 {
        MUTATOR_HOOK(SetStartItems, melee_SetStartItems, CBC_ORDER_ANY);
+       MUTATOR_HOOK(ForbidThrowCurrentWeapon, melee_ForbidThrowing, CBC_ORDER_ANY);
        MUTATOR_HOOK(FilterItem, melee_FilterItem, CBC_ORDER_ANY);
        MUTATOR_HOOK(BuildMutatorsString, melee_BuildMutatorsString, CBC_ORDER_ANY);
        MUTATOR_HOOK(BuildMutatorsPrettyString, melee_BuildMutatorsPrettyString, CBC_ORDER_ANY);