From: Mario Date: Mon, 4 Feb 2013 17:23:59 +0000 (+1100) Subject: Fix a missing mutator hook X-Git-Tag: xonotic-v0.7.0~55^2~3^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a53768f20ae1838a151d010919c8c4d4e4d47cc4;p=xonotic%2Fxonotic-data.pk3dir.git Fix a missing mutator hook --- diff --git a/qcsrc/server/mutators/mutator_minstagib.qc b/qcsrc/server/mutators/mutator_minstagib.qc index 8b1fe6b49..9b6edfae7 100644 --- a/qcsrc/server/mutators/mutator_minstagib.qc +++ b/qcsrc/server/mutators/mutator_minstagib.qc @@ -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);