From: Mario Date: Tue, 9 Apr 2013 04:40:19 +0000 (+1000) Subject: Replace giveplayer entity with other X-Git-Tag: xonotic-v0.7.0~55^2~3^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=020b899e1b7d6afb03e0e7d0e84eb1281a339488;p=xonotic%2Fxonotic-data.pk3dir.git Replace giveplayer entity with other --- diff --git a/qcsrc/server/mutators/base.qh b/qcsrc/server/mutators/base.qh index 91d2d6020..8cd28c102 100644 --- a/qcsrc/server/mutators/base.qh +++ b/qcsrc/server/mutators/base.qh @@ -233,7 +233,6 @@ MUTATOR_HOOKABLE(Item_RespawnCountdown); MUTATOR_HOOKABLE(Item_GiveTo); // called when an item is given to a player - entity giveplayer; entity giveitem; float player_wswitch; float player_pickedup; diff --git a/qcsrc/server/mutators/mutator_minstagib.qc b/qcsrc/server/mutators/mutator_minstagib.qc index 980f2d53b..afada9042 100644 --- a/qcsrc/server/mutators/mutator_minstagib.qc +++ b/qcsrc/server/mutators/mutator_minstagib.qc @@ -331,24 +331,24 @@ MUTATOR_HOOKFUNCTION(minstagib_GiveItem) if(giveitem.ammo_cells) { // play some cool sounds ;) - if (clienttype(giveplayer) == CLIENTTYPE_REAL) + if (IS_CLIENT(other)) { - if(giveplayer.health <= 5) - AnnounceTo(giveplayer, "lastsecond"); - else if(giveplayer.health < 50) - AnnounceTo(giveplayer, "narrowly"); + if(other.health <= 5) + AnnounceTo(other, "lastsecond"); + else if(other.health < 50) + AnnounceTo(other, "narrowly"); } - if(giveplayer.health < 100) - giveplayer.health = 100; + if(other.health < 100) + other.health = 100; player_pickedup = TRUE; } if(giveitem.max_health) { - giveplayer.armorvalue = bound(giveplayer.armorvalue, 999, giveplayer.armorvalue + autocvar_g_minstagib_extralives); - sprint(giveplayer, "^3You picked up some extra lives\n"); + other.armorvalue = bound(other.armorvalue, 999, other.armorvalue + autocvar_g_minstagib_extralives); + sprint(other, "^3You picked up some extra lives\n"); player_pickedup = TRUE; } diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 9e66df92b..87fda06ae 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -659,7 +659,7 @@ float Item_GiveTo(entity item, entity player) :skip - giveplayer = player; + other = player; giveitem = item; player_wswitch = _switchweapon; player_pickedup = pickedup;