add passive stance checks to commands and loading/saving. shouldn't be `

This commit is contained in:
nytmyr
2024-11-09 22:00:20 -06:00
parent 938c72619c
commit 0d970844d3
25 changed files with 132 additions and 12 deletions
+10
View File
@@ -2221,6 +2221,11 @@ bool BotDatabase::LoadBotSettings(Mob* m)
else {
query = fmt::format("`bot_id` = {} AND `stance` = {}", mobID, stanceID);
}
if (stanceID == Stance::Passive) {
LogBotSettings("{} is currently set to {} [#{}]. No saving or loading required.", m->GetCleanName(), Stance::GetName(Stance::Passive), Stance::Passive);
return true;
}
const auto& l = BotSettingsRepository::GetWhere(database, query);
@@ -2268,6 +2273,11 @@ bool BotDatabase::SaveBotSettings(Mob* m)
uint32 charID = (m->IsClient() ? m->CastToClient()->CharacterID() : 0);
uint8 stanceID = (m->IsBot() ? m->CastToBot()->GetBotStance() : 0);
if (stanceID == Stance::Passive) {
LogBotSettings("{} is currently set to {} [#{}]. No saving or loading required.", m->GetCleanName(), Stance::GetName(Stance::Passive), Stance::Passive);
return true;
}
std::string query = "";
if (m->IsClient()) {