From 650be9f592dd95c9458e58811ee079c29f9aa086 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Mon, 29 Jul 2024 02:12:51 +0200 Subject: Core/Player: wiped remaining traces of SpecializationInfo --- src/server/game/Entities/Player/Player.cpp | 4 ++- src/server/game/Entities/Player/Player.h | 34 +++++-------------------- src/server/game/Entities/Unit/TalentGroupInfo.h | 2 +- src/server/game/Handlers/InspectHandler.cpp | 8 +++--- 4 files changed, 14 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 98609bcbceb..55d8097b5ee 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -278,8 +278,11 @@ Player::Player(WorldSession* session) : Unit(true), m_sceneMgr(this) m_lastPotionId = 0; + // Talents _activeTalentGroup = 0; _questRewardedTalentPoints = 0; + _resetTalentsCost = 0; + _resetTalentsTime = 0; m_auraBaseFlatMod.fill(0.0f); m_auraBasePctMod.fill(1.0f); @@ -17361,7 +17364,6 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol UpdateSkillsForLevel(); //update skills after load, to make sure they are correctly update at player load SetNumRespecs(fields.numRespecs); - SetPrimarySpecialization(fields.primarySpecialization); uint32 lootSpecId = fields.lootSpecId; if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(lootSpecId)) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index c82a037a8ba..c648b70fe39 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1082,23 +1082,6 @@ struct GroupUpdateCounter int32 UpdateSequenceNumber; }; -struct TC_GAME_API SpecializationInfo -{ - SpecializationInfo() : ResetTalentsCost(0), ResetTalentsTime(0), ActiveGroup(0) - { - } - - PlayerTalentMap Talents[MAX_SPECIALIZATIONS]; - std::vector Glyphs[MAX_SPECIALIZATIONS]; - uint32 ResetTalentsCost; - time_t ResetTalentsTime; - uint8 ActiveGroup; - -private: - SpecializationInfo(SpecializationInfo const&) = delete; - SpecializationInfo& operator=(SpecializationInfo const&) = delete; -}; - uint32 constexpr PLAYER_MAX_HONOR_LEVEL = 500; uint8 constexpr PLAYER_LEVEL_MIN_HONOR = 10; float constexpr MAX_AREA_SPIRIT_HEALER_RANGE = 20.0f; @@ -1845,12 +1828,7 @@ class TC_GAME_API Player final : public Unit, public GridObject void SetOverrideZonePVPType(ZonePVPTypeOverride type) { SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::OverrideZonePVPType), uint32(type)); } // Talents - uint32 GetTalentResetCost() const { return _specializationInfo.ResetTalentsCost; } - void SetTalentResetCost(uint32 cost) { _specializationInfo.ResetTalentsCost = cost; } - time_t GetTalentResetTime() const { return _specializationInfo.ResetTalentsTime; } - void SetTalentResetTime(time_t time_) { _specializationInfo.ResetTalentsTime = time_; } ChrSpecialization GetPrimarySpecialization() const { return ChrSpecialization(*m_playerData->CurrentSpecID); } - void SetPrimarySpecialization(uint32 spec) { SetUpdateFieldValue(m_values.ModifyValue(&Player::m_playerData).ModifyValue(&UF::PlayerData::CurrentSpecID), spec); } uint32 GetDefaultSpecId() const; ChrSpecializationEntry const* GetPrimarySpecializationEntry() const; @@ -1865,6 +1843,10 @@ class TC_GAME_API Player final : public Unit, public GridObject bool ResetTalents(bool noCost = false); uint32 GetNextResetTalentsCost() const; + uint32 GetTalentResetCost() const { return _resetTalentsCost; } + void SetTalentResetCost(uint32 cost) { _resetTalentsCost = cost; } + time_t GetTalentResetTime() const { return _resetTalentsTime; } + void SetTalentResetTime(time_t time_) { _resetTalentsTime = time_; } void SendTalentsInfoData(); void InitGlyphsForLevel(); @@ -1874,10 +1856,6 @@ class TC_GAME_API Player final : public Unit, public GridObject void SetGlyphSlot(uint8 index, uint32 glyphSlotRecId) { SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::GlyphSlots, index), glyphSlotRecId); } void SetGlyphsEnabled(uint32 slotMask) { SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::GlyphsEnabled), slotMask); } - PlayerTalentMap const* GetTalentMap(uint8 spec) const { return &_specializationInfo.Talents[spec]; } - PlayerTalentMap* GetTalentMap(uint8 spec) { return &_specializationInfo.Talents[spec]; } - std::vector const& GetGlyphs(uint8 spec) const { return _specializationInfo.Glyphs[spec]; } - std::vector& GetGlyphs(uint8 spec) { return _specializationInfo.Glyphs[spec]; } ActionButtonList const& GetActionButtons() const { return m_actionButtons; } void StartLoadingActionButtons(std::function&& callback = nullptr); void LoadActions(PreparedQueryResult result); @@ -3024,12 +3002,12 @@ class TC_GAME_API Player final : public Unit, public GridObject uint32 m_lastPotionId; // last used health/mana potion in combat, that block next potion use std::unordered_map m_storedAuraTeleportLocations; - SpecializationInfo _specializationInfo; - // Talents std::vector _talentGroups; uint8 _activeTalentGroup; uint32 _questRewardedTalentPoints; + uint32 _resetTalentsCost; + time_t _resetTalentsTime; std::unordered_map m_traitConfigStates; diff --git a/src/server/game/Entities/Unit/TalentGroupInfo.h b/src/server/game/Entities/Unit/TalentGroupInfo.h index 7017fa9bd33..623a20f5b24 100644 --- a/src/server/game/Entities/Unit/TalentGroupInfo.h +++ b/src/server/game/Entities/Unit/TalentGroupInfo.h @@ -24,7 +24,7 @@ constexpr uint8 MAX_GLYPHS = 9; -struct TalentGroupInfo +struct TC_GAME_API TalentGroupInfo { uint32 PrimaryTalentTabID = 0; std::unordered_map Talents; diff --git a/src/server/game/Handlers/InspectHandler.cpp b/src/server/game/Handlers/InspectHandler.cpp index 865dcc25152..903bef7790f 100644 --- a/src/server/game/Handlers/InspectHandler.cpp +++ b/src/server/game/Handlers/InspectHandler.cpp @@ -47,10 +47,10 @@ void WorldSession::HandleInspectOpcode(WorldPackets::Inspect::Inspect& inspect) if (GetPlayer()->CanBeGameMaster() || sWorld->getIntConfig(CONFIG_TALENTS_INSPECTING) + (GetPlayer()->GetEffectiveTeam() == player->GetEffectiveTeam()) > 1) { - PlayerTalentMap const* talents = player->GetTalentMap(player->GetActiveTalentGroup()); - for (PlayerTalentMap::value_type const& v : *talents) - if (v.second != PLAYERSPELL_REMOVED) - inspectResult.Talents.push_back(v.first); + //PlayerTalentMap const* talents = player->GetTalentMap(player->GetActiveTalentGroup()); + //for (PlayerTalentMap::value_type const& v : *talents) + // if (v.second != PLAYERSPELL_REMOVED) + // inspectResult.Talents.push_back(v.first); inspectResult.TalentTraits.Level = player->GetLevel(); inspectResult.TalentTraits.ChrSpecializationID = AsUnderlyingType(player->GetPrimarySpecialization()); -- cgit v1.2.3