[Bots] Make expansion settings universal
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled

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:
nytmyr
2026-02-08 21:37:25 -06:00
committed by Alex
parent 024abf74a8
commit 7c026ab25c
6 changed files with 236 additions and 212 deletions
@@ -2126,7 +2126,38 @@ WHERE NOT EXISTS
FROM spells_new
WHERE bot_spells_entries.spell_id = spells_new.id);
)",
}
},
ManifestEntry{
.version = 9055,
.description = "2026_02_8_move_expansion_bitmask.sql",
.check = "SHOW COLUMNS FROM `bot_data` LIKE 'expansion_bitmask'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `bot_data`
ADD COLUMN `expansion_bitmask` INT(11) NOT NULL DEFAULT '0' AFTER `corruption`;
UPDATE bot_data bd
SET bd.expansion_bitmask = COALESCE(
(SELECT bs.`value`
FROM bot_settings bs
WHERE bs.`setting_id` = 0
AND bs.`setting_type` = 0
AND bs.bot_id = bd.bot_id
ORDER BY bs.`value` DESC
LIMIT 1),
(SELECT rv.rule_value
FROM rule_values rv
WHERE rv.rule_name = 'Bots:BotExpansionSettings')
);
DELETE
FROM bot_settings
WHERE `setting_id` = 0
AND `setting_type` = 0;
)"
}
// -- template; copy/paste this when you need to create a new entry
// ManifestEntry{
// .version = 9228,