From: Lyberta Date: Mon, 28 Aug 2017 19:30:54 +0000 (+0300) Subject: Random start weapons: Use GetResourceAmount. X-Git-Tag: xonotic-v0.8.5~2459^2~14 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fc552df9876035b3187335ae7cf6999d6e639a17;p=xonotic%2Fxonotic-data.pk3dir.git Random start weapons: Use GetResourceAmount. --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index e982147f8..116b609c9 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -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; }