fix AA loading and expansionbitmask saving/loading

This commit is contained in:
nytmyr
2024-12-01 20:36:27 -06:00
parent 867771e76b
commit 962e2d80b9
3 changed files with 5 additions and 5 deletions
+3 -4
View File
@@ -248,12 +248,12 @@ Bot::Bot(
database.botdb.LoadTimers(this);
LoadAAs();
LoadDefaultBotSettings();
database.botdb.LoadBotSettings(this);
LoadAAs();
if (database.botdb.LoadBuffs(this)) {
//reapply some buffs
uint32 buff_count = GetMaxBuffSlots();
@@ -1258,7 +1258,6 @@ int32 Bot::GenerateBaseHitPoints() {
}
void Bot::LoadAAs() {
aa_ranks.clear();
int id = 0;
@@ -10213,7 +10212,7 @@ void Bot::LoadDefaultBotSettings() {
uint8 botStance = GetBotStance();
for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) {
for (uint16 i = BotBaseSettings::START_ALL; i <= BotBaseSettings::END; ++i) {
SetBotBaseSetting(i, GetDefaultSetting(BotSettingCategories::BaseSetting, i, botStance));
LogBotSettingsDetail("{} says, 'Setting default {} [{}] to [{}]'", GetCleanName(), GetBotSettingCategoryName(i), i, GetDefaultBotBaseSetting(i, botStance)); //deleteme
}
+1
View File
@@ -142,6 +142,7 @@ namespace BotBaseSettings {
constexpr uint16 HPWhenToMed = 12;
constexpr uint16 ManaWhenToMed = 13;
constexpr uint16 START_ALL = ExpansionBitmask;
constexpr uint16 START = BotBaseSettings::ShowHelm; // Everything above this cannot be copied, changed or viewed by players
constexpr uint16 END = BotBaseSettings::ManaWhenToMed; // Increment as needed
};
+1 -1
View File
@@ -2294,7 +2294,7 @@ bool BotDatabase::SaveBotSettings(Mob* m)
if (m->IsBot()) {
uint8 botStance = m->CastToBot()->GetBotStance();
for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) {
for (uint16 i = BotBaseSettings::START_ALL; i <= BotBaseSettings::END; ++i) {
if (m->CastToBot()->GetBotBaseSetting(i) != m->CastToBot()->GetDefaultBotBaseSetting(i, botStance)) {
auto e = BotSettingsRepository::BotSettings{
.char_id = charID,