]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Random start weapons: Use GetResourceAmount.
authorLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 19:30:54 +0000 (22:30 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 19:30:54 +0000 (22:30 +0300)
qcsrc/common/t_items.qc

index e982147f8dcb86adb52754056005fc5609b9e197..116b609c9e3df305b6e77df6142a1bfac259f357 100644 (file)
@@ -715,7 +715,7 @@ void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names,
                {
                        case (ammo_shells):
                        {
-                               if (receiver.ammo_shells != 0)
+                               if (GetResourceAmount(receiver, RESOURCE_SHELLS) != 0)
                                {
                                        break;
                                }
@@ -724,7 +724,7 @@ void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names,
                        }
                        case (ammo_nails):
                        {
-                               if (receiver.ammo_nails != 0)
+                               if (GetResourceAmount(receiver, RESOURCE_BULLETS) != 0)
                                {
                                        break;
                                }
@@ -733,7 +733,7 @@ void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names,
                        }
                        case (ammo_rockets):
                        {
-                               if (receiver.ammo_rockets != 0)
+                               if (GetResourceAmount(receiver, RESOURCE_ROCKETS) != 0)
                                {
                                        break;
                                }
@@ -742,7 +742,7 @@ void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names,
                        }
                        case (ammo_cells):
                        {
-                               if (receiver.ammo_cells != 0)
+                               if (GetResourceAmount(receiver, RESOURCE_CELLS) != 0)
                                {
                                        break;
                                }
@@ -751,7 +751,7 @@ void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names,
                        }
                        case (ammo_plasma):
                        {
-                               if (receiver.ammo_plasma != 0)
+                               if (GetResourceAmount(receiver, RESOURCE_PLASMA) != 0)
                                {
                                        break;
                                }