mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Bots] Make expansion settings universal
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:
@@ -460,6 +460,7 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot)
|
||||
loaded_bot->SetSurname(e.last_name);
|
||||
loaded_bot->SetTitle(e.title);
|
||||
loaded_bot->SetSuffix(e.suffix);
|
||||
loaded_bot->SetExpansionBitmask(e.expansion_bitmask);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -514,6 +515,7 @@ bool BotDatabase::SaveNewBot(Bot* b, uint32& bot_id)
|
||||
e.poison = b->GetBasePR();
|
||||
e.disease = b->GetBaseDR();
|
||||
e.corruption = b->GetBaseCorrup();
|
||||
e.expansion_bitmask = b->GetExpansionBitmask();
|
||||
|
||||
e = BotDataRepository::InsertOne(database, e);
|
||||
|
||||
@@ -578,6 +580,7 @@ bool BotDatabase::SaveBot(Bot* b)
|
||||
e.poison = b->GetBasePR();
|
||||
e.disease = b->GetBaseDR();
|
||||
e.corruption = b->GetBaseCorrup();
|
||||
e.expansion_bitmask = b->GetExpansionBitmask();
|
||||
|
||||
return BotDataRepository::UpdateOne(database, e);
|
||||
}
|
||||
@@ -2351,7 +2354,7 @@ bool BotDatabase::SaveBotSettings(Mob* m)
|
||||
if (m->IsBot()) {
|
||||
uint8 bot_stance = m->CastToBot()->GetBotStance();
|
||||
|
||||
for (uint16 i = BotBaseSettings::START_ALL; i <= BotBaseSettings::END; ++i) {
|
||||
for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) {
|
||||
if (m->CastToBot()->GetBotBaseSetting(i) != m->CastToBot()->GetDefaultBotBaseSetting(i, bot_stance)) {
|
||||
auto e = BotSettingsRepository::BotSettings{
|
||||
.character_id = character_id,
|
||||
|
||||
Reference in New Issue
Block a user