]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Replace giveplayer entity with other
authorMario <mario.mario@y7mail.com>
Tue, 9 Apr 2013 04:40:19 +0000 (14:40 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 9 Apr 2013 04:40:19 +0000 (14:40 +1000)
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/mutator_minstagib.qc
qcsrc/server/t_items.qc

index 91d2d602062a8096235d592894f252aa211d428e..8cd28c102e69491e2347d46b3c338a5cd42e61a6 100644 (file)
@@ -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;
index 980f2d53b6a0c614536a1d31b52c698d405c0d7e..afada904206dabedb8f409e138bde0243d88bb42 100644 (file)
@@ -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;
        }
                
index 9e66df92be7ced5428d9bfe58c0ec029125acfa8..87fda06aef9b6a76675903a8ff4e66eec2acf88d 100644 (file)
@@ -659,7 +659,7 @@ float Item_GiveTo(entity item, entity player)
 
 :skip
 
-       giveplayer = player;
+       other = player;
        giveitem = item;
        player_wswitch = _switchweapon;
        player_pickedup = pickedup;