[Commands] [Hotfix] Fix Illusion Block (#4666)

* [Commands] [Hotfix] Fix Illusion Block

This wasn't properly being set or saved if bots were not enabled, moved to extended character profile for players.

* Move out of EPP

* ValueWithin

* I learned a new word today - idempotent

I'm dumb. Will forget it tomorrow.

* Move saving to ZoneDatabase, inline SetIllusionBlock
This commit is contained in:
nytmyr
2025-02-12 00:18:34 -06:00
committed by GitHub
parent ac4ffefa09
commit d9d2d5d47c
10 changed files with 54 additions and 11 deletions
+2
View File
@@ -2345,6 +2345,7 @@ bool BotDatabase::SaveBotSettings(Mob* m)
}
if (m->IsClient()) {
/* Currently unused
if (m->CastToClient()->GetDefaultBotSettings(BotSettingCategories::BaseSetting, BotBaseSettings::IllusionBlock) != m->CastToClient()->GetIllusionBlock()) { // Only illusion block supported
auto e = BotSettingsRepository::BotSettings{
.character_id = character_id,
@@ -2361,6 +2362,7 @@ bool BotDatabase::SaveBotSettings(Mob* m)
LogBotSettings("{} says, 'Saving {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), Bot::GetBotSettingCategoryName(BotBaseSettings::IllusionBlock), BotBaseSettings::IllusionBlock, e.value, m->CastToClient()->GetIllusionBlock());
}
*/
for (uint16 i = BotSettingCategories::START_CLIENT; i <= BotSettingCategories::END_CLIENT; ++i) {
for (uint16 x = BotSpellTypes::START; x <= BotSpellTypes::END; ++x) {