all_or_nothings bots fix

Fixed the infinite loop when using giveLoadout on a bot preventing us from giving a throwing knife and the scavenger specialist bonus on bots
This commit is contained in:
Resxt 2022-09-08 09:01:37 +02:00
parent 4356563fd9
commit 61f14dab32
2 changed files with 11 additions and 2 deletions

View File

@ -2,4 +2,4 @@
## all_or_nothing.gsc ## all_or_nothing.gsc
Recreation of the Modern Warfare 3 All or Nothing gamemode based on [the wiki](https://callofduty.fandom.com/wiki/All_or_Nothing_(Game_Mode)#Call_of_Duty:_Modern_Warfare_3). Recreation of the Modern Warfare 3 All or Nothing gamemode based on [the wiki](https://callofduty.fandom.com/wiki/All_or_Nothing_(Game_Mode)#Call_of_Duty:_Modern_Warfare_3).
Sadly the scavenger killstreak and giving a throwing knife doesn't work for bots since for some reason the `giveLoadout()` function in `ReplaceKillstreaks()` causes an infinite loop that crashes the game. The bots won't use their throwing knives often and when they do they will use preset grenade spots, they won't directly aim at a player.

View File

@ -110,10 +110,19 @@ ReplaceKillstreaks()
self.pers["gamemodeLoadout"]["loadoutKillstreak2"] = "none"; self.pers["gamemodeLoadout"]["loadoutKillstreak2"] = "none";
self.pers["gamemodeLoadout"]["loadoutKillstreak3"] = "none"; self.pers["gamemodeLoadout"]["loadoutKillstreak3"] = "none";
if (!isDefined(self.pers["isBot"]) || !self.pers["isBot"]) if (self IsBot())
{
self maps\mp\bots\_bot_utility::botGiveLoadout(self.team, "gamemode", false, true);
}
else
{ {
self maps\mp\gametypes\_class::giveLoadout(self.team, "gamemode", false, true); self maps\mp\gametypes\_class::giveLoadout(self.team, "gamemode", false, true);
} }
maps\mp\killstreaks\_killstreaks::clearKillstreaks(); maps\mp\killstreaks\_killstreaks::clearKillstreaks();
} }
IsBot()
{
return IsDefined(self.pers["isBot"]) && self.pers["isBot"];
}