]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a missing mutator hook
authorMario <mario.mario@y7mail.com>
Mon, 4 Feb 2013 17:23:59 +0000 (04:23 +1100)
committerMario <mario.mario@y7mail.com>
Mon, 4 Feb 2013 17:23:59 +0000 (04:23 +1100)
qcsrc/server/mutators/mutator_minstagib.qc

index 8b1fe6b49e04adf2e7b07530594797437c92d0c8..9b6edfae7b3d6130c2c4872fd666434b6e03aa6f 100644 (file)
@@ -322,14 +322,8 @@ MUTATOR_HOOKFUNCTION(minstagib_ItemCountdown)
 
 MUTATOR_HOOKFUNCTION(minstagib_GiveItem)
 {
-       float it;
-       float prevcells = giveplayer.ammo_cells;
-       
-       player_pickedup |= Item_GiveAmmoTo(giveitem, giveplayer, ammo_cells, 999, ITEM_MODE_NONE);
-
-       if(giveplayer.ammo_cells > prevcells)
+       if(giveitem.ammo_cells)
        {
-               player_wswitch = TRUE;
                // play some cool sounds ;)
                if (clienttype(giveplayer) == CLIENTTYPE_REAL)
                {
@@ -339,46 +333,9 @@ MUTATOR_HOOKFUNCTION(minstagib_GiveItem)
                                AnnounceTo(giveplayer, "narrowly");
                }
 
-               if (WEPSET_CONTAINS_EW(giveitem, WEP_MINSTANEX))
-                       W_GiveWeapon (giveplayer, WEP_MINSTANEX, giveitem.netname);
                if(giveplayer.health < 100)
                        giveplayer.health = 100;
        }
-
-       if((it = (giveitem.items - (giveitem.items & giveplayer.items)) & IT_PICKUPMASK))
-       {
-               player_pickedup = TRUE;
-               giveplayer.items |= it;
-               sprint (giveplayer, strcat("You got the ^2", giveitem.netname, "\n"));
-       }
-
-       // extralife powerup
-       if (giveitem.max_health)
-       {
-               player_pickedup = TRUE;
-               // sound not available
-               // AnnounceTo(giveplayer, "_lives");
-               giveplayer.armorvalue = bound(giveplayer.armorvalue, 999, giveplayer.armorvalue + autocvar_g_minstagib_extralives);
-               sprint(giveplayer, "^3You picked up some extra lives\n");
-       }
-
-       // invis powerup
-       if (giveitem.strength_finished)
-       {
-               player_pickedup = TRUE;
-               // sound not available
-               // AnnounceTo(giveplayer, "invisible");
-               giveplayer.strength_finished = max(giveplayer.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
-       }
-
-       // speed powerup
-       if (giveitem.invincible_finished)
-       {
-               player_pickedup = TRUE;
-               // sound not available
-               // AnnounceTo(giveplayer, "speed");
-               giveplayer.invincible_finished = max(giveplayer.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
-       }
                
        return TRUE;
 }
@@ -404,6 +361,7 @@ MUTATOR_DEFINITION(mutator_minstagib)
        MUTATOR_HOOK(PlayStrengthSound, minstagib_PlayStrengthSound, CBC_ORDER_ANY);
        MUTATOR_HOOK(MakePlayerObserver, minstagib_MakePlayerObserver, CBC_ORDER_ANY);
        MUTATOR_HOOK(SetStartItems, minstagib_SetStartItems, CBC_ORDER_ANY);
+       MUTATOR_HOOK(Item_GiveTo, minstagib_GiveItem, CBC_ORDER_ANY);
        MUTATOR_HOOK(FilterItem, minstagib_FilterItem, CBC_ORDER_ANY);
        MUTATOR_HOOK(Item_RespawnCountdown, minstagib_ItemCountdown, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, minstagib_SplitHealthArmor, CBC_ORDER_ANY);