Guild fixes

This commit is contained in:
Keleborn 2026-04-09 14:56:44 -07:00
parent 4bcf8fd2c4
commit fd5910e4b6
3 changed files with 12 additions and 8 deletions

View File

@ -85,6 +85,7 @@ public:
void InitKeyring();
void InitReputation();
void InitAttunementQuests();
void InitGuild();
private:
void Prepare();
@ -117,7 +118,6 @@ private:
void InitInventoryEquip();
void InitInventorySkill();
Item* StoreItem(uint32 itemId, uint32 count);
void InitGuild();
void InitArenaTeam();
void InitImmersive();
static void AddPrevQuests(uint32 questId, std::list<uint32>& questIds);

View File

@ -2532,6 +2532,13 @@ void RandomPlayerbotMgr::OnBotLoginInternal(Player* const bot)
}
}
// Run guild recovery/assignment at login to handle empty guild tables after restart.
if (sPlayerbotAIConfig.randomBotGuildCount > 0)
{
PlayerbotFactory factory(bot, bot->GetLevel());
factory.InitGuild();
}
if (sPlayerbotAIConfig.randomBotFixedLevel)
{
bot->SetPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);

View File

@ -150,13 +150,10 @@ void PlayerbotGuildMgr::OnGuildUpdate(Guild* guild)
void PlayerbotGuildMgr::ResetGuildCache()
{
for (auto it = _guildCache.begin(); it != _guildCache.end();)
{
GuildCache& cached = it->second;
cached.memberCount = 0;
cached.faction = 2;
cached.status = 0;
}
_guildCache.clear();
for (auto& nameEntry : _guildNames)
nameEntry.second = true;
}
void PlayerbotGuildMgr::LoadGuildNames()