[Bots] Make expansion settings universal
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled

Expansion Bitmask settings were saved by stances and should be universal for the bot.

This addresses that as well as moves the data back to the `bot_data` table instead of the `bot_settings` table.

This will check current settings saved and take the highest value of the stances to save to `bot_data`, if none are found (default), it will use the value from the rule `Bots:BotExpansionSettings`
This commit is contained in:
nytmyr
2026-02-08 21:37:25 -06:00
committed by Alex
parent 024abf74a8
commit 7c026ab25c
6 changed files with 236 additions and 212 deletions
+2 -9
View File
@@ -10395,9 +10395,6 @@ void Bot::SetBotSetting(uint8 setting_type, uint16 bot_setting, int setting_valu
void Bot::SetBotBaseSetting(uint16 bot_setting, int setting_value) {
switch (bot_setting) {
case BotBaseSettings::ExpansionBitmask:
SetExpansionBitmask(setting_value);
break;
case BotBaseSettings::ShowHelm:
SetShowHelm(setting_value);
break;
@@ -10444,8 +10441,6 @@ void Bot::SetBotBaseSetting(uint16 bot_setting, int setting_value) {
int Bot::GetBotBaseSetting(uint16 bot_setting) {
switch (bot_setting) {
case BotBaseSettings::ExpansionBitmask:
return GetExpansionBitmask();
case BotBaseSettings::ShowHelm:
return GetShowHelm();
case BotBaseSettings::FollowDistance:
@@ -10481,8 +10476,6 @@ int Bot::GetBotBaseSetting(uint16 bot_setting) {
int Bot::GetDefaultBotBaseSetting(uint16 bot_setting, uint8 stance) {
switch (bot_setting) {
case BotBaseSettings::ExpansionBitmask:
return RuleI(Bots, BotExpansionSettings);
case BotBaseSettings::ShowHelm:
return true;
case BotBaseSettings::FollowDistance:
@@ -10541,7 +10534,7 @@ void Bot::LoadDefaultBotSettings() {
uint8 bot_stance = GetBotStance();
for (uint16 i = BotBaseSettings::START_ALL; i <= BotBaseSettings::END; ++i) {
for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) {
SetBotBaseSetting(i, GetDefaultSetting(BotSettingCategories::BaseSetting, i, bot_stance));
LogBotSettingsDetail("{} says, 'Setting default {} [{}] to [{}]'", GetCleanName(), GetBotSettingCategoryName(i), i, GetDefaultBotBaseSetting(i, bot_stance));
}
@@ -12925,7 +12918,7 @@ uint16 Bot::GetBotSpellCategoryIDByShortName(std::string setting_string) {
}
bool Bot::IsValidBotBaseSetting(uint16 setting_type) {
return EQ::ValueWithin(setting_type, BotBaseSettings::START_ALL, BotBaseSettings::END);
return EQ::ValueWithin(setting_type, BotBaseSettings::START, BotBaseSettings::END);
}
std::string Bot::GetBotSettingCategoryName(uint16 setting_type) {