This commit is contained in:
Your Name 2020-08-20 16:32:03 -06:00
parent 03d676f0eb
commit 14d92e01bd

View File

@ -279,11 +279,21 @@ chooseRandomPerk(perkkind)
{ {
perks = getPerks(perkkind); perks = getPerks(perkkind);
rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData("experience") ); rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData("experience") );
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
while (true) while (true)
{ {
perk = random(perks); perk = random(perks);
if (!allowOp)
{
if (perkkind == "perk4")
return "specialty_null";
if (perk == "specialty_pistoldeath")
continue;
}
if (perk == "specialty_null") if (perk == "specialty_null")
continue; continue;
@ -315,11 +325,18 @@ chooseRandomCamo()
chooseRandomPrimary() chooseRandomPrimary()
{ {
primaries = getPrimaries(); primaries = getPrimaries();
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
while (true) while (true)
{ {
primary = random(primaries); primary = random(primaries);
if (!allowOp)
{
if (primary == "riotshield")
continue;
}
if (!self isItemUnlocked(primary)) if (!self isItemUnlocked(primary))
continue; continue;
@ -333,11 +350,18 @@ chooseRandomSecondary(perk1)
return "onemanarmy"; return "onemanarmy";
secondaries = getSecondaries(); secondaries = getSecondaries();
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
while (true) while (true)
{ {
secondary = random(secondaries); secondary = random(secondaries);
if (!allowOp)
{
if (secondary == "at4" || secondary == "rpg" || secondary == "m79")
continue;
}
if (!self isItemUnlocked(secondary)) if (!self isItemUnlocked(secondary))
continue; continue;
@ -351,6 +375,7 @@ chooseRandomSecondary(perk1)
chooseRandomAttachmentComboForGun(gun) chooseRandomAttachmentComboForGun(gun)
{ {
atts = getAttachmentsForGun(gun); atts = getAttachmentsForGun(gun);
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
while (true) while (true)
{ {
@ -360,6 +385,12 @@ chooseRandomAttachmentComboForGun(gun)
if (!isValidAttachmentCombo(att1, att2)) if (!isValidAttachmentCombo(att1, att2))
continue; continue;
if (!allowOp)
{
if (att1 == "gl" || att2 == "gl")
continue;
}
retAtts = []; retAtts = [];
retAtts[0] = att1; retAtts[0] = att1;
retAtts[1] = att2; retAtts[1] = att2;