Changed Bots:AAExpansion to Bots:BotExpansionSettings and converted it bitmask use; Fix for bots not honoring aa expansion setting

This commit is contained in:
Uleat 2019-12-03 23:39:46 -05:00
parent 35fe27eb5d
commit 9910b07a4e
3 changed files with 18 additions and 8 deletions

View File

@ -572,7 +572,7 @@ RULE_CATEGORY_END()
#ifdef BOTS
RULE_CATEGORY(Bots)
RULE_INT(Bots, AAExpansion, 8, "Bots get AAs through this expansion")
RULE_INT(Bots, BotExpansionSettings, 16383, "Sets the expansion settings for bot use. Defaults to all expansions enabled up to TSS")
RULE_BOOL(Bots, AllowCamelCaseNames, false, "Allows the use of 'MyBot' type names")
RULE_INT(Bots, CommandSpellRank, 1, "Filters bot command spells by rank (1, 2 and 3 are valid filters - any other number allows all ranks)")
RULE_INT(Bots, CreationLimit, 150, "Number of bots that each account can create")

View File

@ -1467,12 +1467,20 @@ bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank) {
}
}
if(IsClient()) {
if(rank->expansion && !(CastToClient()->GetPP().expansions & (1 << (rank->expansion - 1)))) {
if (IsClient()) {
if (rank->expansion && !(CastToClient()->GetPP().expansions & (1 << (rank->expansion - 1)))) {
return false;
}
} else {
if(rank->expansion && !(RuleI(World, ExpansionSettings) & (1 << (rank->expansion - 1)))) {
}
#ifdef BOTS
else if (IsBot()) {
if (rank->expansion && !(RuleI(Bots, BotExpansionSettings) & (1 << (rank->expansion - 1)))) {
return false;
}
}
#endif
else {
if (rank->expansion && !(RuleI(World, ExpansionSettings) & (1 << (rank->expansion - 1)))) {
return false;
}
}

View File

@ -1606,7 +1606,7 @@ int32 Bot::GenerateBaseHitPoints() {
}
void Bot::LoadAAs() {
int maxAAExpansion = RuleI(Bots, AAExpansion); //get expansion to get AAs up to
aa_ranks.clear();
int id = 0;
@ -8852,15 +8852,17 @@ void Bot::CalcBotStats(bool showtext) {
GetBotOwner()->Message(Chat::Yellow, "Updating %s...", GetCleanName());
}
if(!IsValidRaceClassCombo()) {
// this code is annoying since many classes change their name and illusions change the race id
/*if(!IsValidRaceClassCombo()) {
GetBotOwner()->Message(Chat::Yellow, "A %s - %s bot was detected. Is this Race/Class combination allowed?.", GetRaceIDName(GetRace()), GetClassIDName(GetClass(), GetLevel()));
GetBotOwner()->Message(Chat::Yellow, "Previous Bots Code releases did not check Race/Class combinations during create.");
GetBotOwner()->Message(Chat::Yellow, "Unless you are experiencing heavy lag, you should delete and remake this bot.");
}
}*/
if(GetBotOwner()->GetLevel() != GetLevel())
SetLevel(GetBotOwner()->GetLevel());
LoadAAs();
GenerateSpecialAttacks();
if(showtext) {