diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 151048410..a222e5e93 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -934,6 +934,7 @@ void Client::CompleteConnect() } database.LoadAuras(this); // this ends up spawning them so probably safer to load this later (here) + database.LoadCharacterDisciplines(this); entity_list.RefreshClientXTargets(this); @@ -1318,7 +1319,6 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) database.LoadCharacterInspectMessage(cid, &m_inspect_message); /* Load Character Inspect Message */ database.LoadCharacterSpellBook(cid, &m_pp); /* Load Character Spell Book */ database.LoadCharacterMemmedSpells(cid, &m_pp); /* Load Character Memorized Spells */ - database.LoadCharacterDisciplines(cid, &m_pp); /* Load Character Disciplines */ database.LoadCharacterLanguages(cid, &m_pp); /* Load Character Languages */ database.LoadCharacterLeadershipAbilities(cid, &m_pp); /* Load Character Leadership AA's */ database.LoadCharacterTribute(this); /* Load CharacterTribute */ diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 9916d3c65..bcfaa935d 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -671,12 +671,16 @@ bool ZoneDatabase::LoadCharacterLeadershipAbilities(uint32 character_id, PlayerP return true; } -bool ZoneDatabase::LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp){ +bool ZoneDatabase::LoadCharacterDisciplines(Client* c) +{ + if (!c) { + return false; + } const auto& l = CharacterDisciplinesRepository::GetWhere( database, fmt::format( "`id` = {} ORDER BY `slot_id`", - character_id + c->CharacterID() ) ); @@ -684,16 +688,18 @@ bool ZoneDatabase::LoadCharacterDisciplines(uint32 character_id, PlayerProfile_S return false; } - for (int slot_id = 0; slot_id < MAX_PP_DISCIPLINES; slot_id++) { // Initialize Disciplines - pp->disciplines.values[slot_id] = 0; + for (int slot_id = 0; slot_id < MAX_PP_DISCIPLINES; slot_id++) { + c->GetPP().disciplines.values[slot_id] = 0; } for (const auto& e : l) { if (IsValidSpell(e.disc_id) && e.slot_id < MAX_PP_DISCIPLINES) { - pp->disciplines.values[e.slot_id] = e.disc_id; + c->GetPP().disciplines.values[e.slot_id] = e.disc_id; } } + c->SendDisciplineUpdate(); + return true; } diff --git a/zone/zonedb.h b/zone/zonedb.h index c389577b7..ca0447758 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -436,7 +436,7 @@ public: bool LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Struct* pp); bool LoadCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp); bool LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp); - bool LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp); + bool LoadCharacterDisciplines(Client* c); bool LoadCharacterFactionValues(uint32 character_id, faction_map & val_list); bool LoadCharacterLanguages(uint32 character_id, PlayerProfile_Struct* pp); bool LoadCharacterLeadershipAbilities(uint32 character_id, PlayerProfile_Struct* pp);