From: Lyberta Date: Sat, 2 Sep 2017 18:51:57 +0000 (+0300) Subject: Random Start Weapons: Updated to URS3. X-Git-Tag: xonotic-v0.8.5~2459^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0a7198ec8e316b5c8e1542b7059e55fdeb5d964f;p=xonotic%2Fxonotic-data.pk3dir.git Random Start Weapons: Updated to URS3. --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 590d5669c..92c80d711 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -711,50 +711,39 @@ void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names, return; } receiver.weapons |= RandomSelection_chosen_ent.m_wepset; - switch (RandomSelection_chosen_ent.ammo_field) + if (RandomSelection_chosen_ent.ammo_type == RESOURCE_NONE) { - case (ammo_shells): + continue; + } + if (GetResourceAmount(receiver, + RandomSelection_chosen_ent.ammo_type) != 0) + { + continue; + } + switch (RandomSelection_chosen_ent.ammo_type) + { + case (RESOURCE_SHELLS): { - if (GetResourceAmount(receiver, RESOURCE_SHELLS) != 0) - { - break; - } GiveResource(receiver, RESOURCE_SHELLS, shells); break; } - case (ammo_nails): + case (RESOURCE_BULLETS): { - if (GetResourceAmount(receiver, RESOURCE_BULLETS) != 0) - { - break; - } GiveResource(receiver, RESOURCE_BULLETS, bullets); break; } - case (ammo_rockets): + case (RESOURCE_ROCKETS): { - if (GetResourceAmount(receiver, RESOURCE_ROCKETS) != 0) - { - break; - } GiveResource(receiver, RESOURCE_ROCKETS, rockets); break; } - case (ammo_cells): + case (RESOURCE_CELLS): { - if (GetResourceAmount(receiver, RESOURCE_CELLS) != 0) - { - break; - } GiveResource(receiver, RESOURCE_CELLS, cells); break; } - case (ammo_plasma): + case (RESOURCE_PLASMA): { - if (GetResourceAmount(receiver, RESOURCE_PLASMA) != 0) - { - break; - } GiveResource(receiver, RESOURCE_PLASMA, plasma); break; }