mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Bots] Save Bot Toggle Archer Setting between Loads. (#2612)
* [Bots] Save Bot Toggle Archer Setting between Loads. * [Bots] Save Bot Toggle Archer Setting between Loads. * Typo
This commit is contained in:
+25
-1
@@ -410,7 +410,8 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot)
|
||||
" `follow_distance`," // 26
|
||||
" `stop_melee_level`," // 27
|
||||
" `expansion_bitmask`," // 28
|
||||
" `enforce_spell_settings`" // 29
|
||||
" `enforce_spell_settings`," // 29
|
||||
" `archery_setting`" // 30
|
||||
" FROM `bot_data`"
|
||||
" WHERE `bot_id` = {}"
|
||||
" LIMIT 1",
|
||||
@@ -511,6 +512,8 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot)
|
||||
loaded_bot->SetExpansionBitmask(eb, false);
|
||||
|
||||
loaded_bot->SetBotEnforceSpellSetting((std::stoi(row[29]) > 0 ? true : false));
|
||||
|
||||
loaded_bot->SetBotArcherySetting((std::stoi(row[30]) > 0 ? true : false));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3302,6 +3305,27 @@ bool BotDatabase::SaveEnforceSpellSetting(const uint32 bot_id, const bool enforc
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BotDatabase::SaveBotArcherSetting(const uint32 bot_id, const bool bot_archer_setting)
|
||||
{
|
||||
if (!bot_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
query = fmt::format(
|
||||
"UPDATE `bot_data`"
|
||||
"SET `archery_setting` = {} "
|
||||
"WHERE `bot_id` = {}",
|
||||
(bot_archer_setting ? 1 : 0),
|
||||
bot_id
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* fail::Bot functions */
|
||||
const char* BotDatabase::fail::LoadBotsList() { return "Failed to bots list"; }
|
||||
const char* BotDatabase::fail::LoadOwnerID() { return "Failed to load owner ID"; }
|
||||
|
||||
Reference in New Issue
Block a user