diff --git a/src/AdvancementMgr.cpp b/src/AdvancementMgr.cpp index 61646e1..f256d77 100644 --- a/src/AdvancementMgr.cpp +++ b/src/AdvancementMgr.cpp @@ -171,43 +171,26 @@ int32 AdvancementMgr::LoadPlayerAdvancements(Player* player) { /** * Load Material Types from the database into memory */ -int32 AdvancementMgr::LoadPlayerAdvancements(Player* player) { +int32 AdvancementMgr::LoadMaterialTypes() { constexpr std::string_view query = R"( SELECT - guid, - advancementId, - bonus, - upgradeRank, - diceSpent - FROM mp_player_advancements - WHERE guid = {} + materialId, + entry + FROM mp_material_types )"; - QueryResult result = CharacterDatabase.Query(query, player->GetGUID().GetCounter()); - - // If the player does not have any upgrades just return not a problem until they purchase one. - if(!result) { - return 0; - } + QueryResult result = WorldDatabase.Query(query); do { Field* fields = result->Fetch(); - uint32 guid = fields[0].Get(); - uint32 advancementId = fields[1].Get(); - float bonus = fields[2].Get(); - uint32 upgradeRank = fields[3].Get(); - uint32 diceSpent = fields[4].Get(); + uint32 materialId = fields[0].Get(); + uint32 entry = fields[1].Get(); - MpAdvancements advancement = static_cast(advancementId); - MpPlayerRank playerRank = MpPlayerRank(); - playerRank.rank = upgradeRank; - playerRank.advancementId = advancement; - playerRank.diceSpent = diceSpent; - playerRank.bonus = bonus; - - // List of all ranks keyed by rank, advancementId - _playerAdvancements[guid][advancement] = playerRank; + if(!_materialTypes.contains(materialId)) { + _materialTypes.emplace(materialId,std::vector()); + } + _materialTypes.at(materialId).push_back(entry); } while (result->NextRow()); diff --git a/src/MpDataStore.cpp b/src/MpDataStore.cpp index 16f6460..9713d24 100644 --- a/src/MpDataStore.cpp +++ b/src/MpDataStore.cpp @@ -136,12 +136,10 @@ void MpDataStore::RemoveGroupData(Group *group) { CharacterDatabase.Execute("DELETE FROM group_difficulty WHERE guid = {}) ", group->GetGUID().GetCounter()); } +// Adds PlayerData related to MythicRun Status to map void MpDataStore::AddPlayerData(ObjectGuid guid, MpPlayerData* pd) { - MpLogger::debug("AddPlayerData for player {}", guid.GetCounter()); _playerData->emplace(guid, pd); - // get the player - Player* player = ObjectAccessor::FindPlayer(guid); } void MpDataStore::RemovePlayerData(ObjectGuid guid) { diff --git a/src/MythicPlus.cpp b/src/MythicPlus.cpp index 684dc49..b7854cd 100644 --- a/src/MythicPlus.cpp +++ b/src/MythicPlus.cpp @@ -113,8 +113,6 @@ bool MythicPlus::EligibleDamageTarget(Unit* target) bool MythicPlus::IsCreatureEligible(Creature* creature) { - CreatureTemplate const * cInfo = creature->GetCreatureTemplate(); - if (!creature) { return false; } @@ -461,7 +459,6 @@ int32 MythicPlus::ScaleHealSpell(SpellInfo const * spellInfo, uint32 heal, MpCre auto effects = spellInfo->GetEffects(); for (uint8 i = 0; i < effects.size(); ++i) { - SpellEffectInfo effect = effects[i]; MpLogger::debug(" >>> Spell {} effect {} value: {} by creature {}", spellInfo->SpellName[i], effects[i].Effect, heal, creature->GetName()); } @@ -476,8 +473,8 @@ int32 MythicPlus::ScaleHealSpell(SpellInfo const * spellInfo, uint32 heal, MpCre return int32(heal * scalingFactor * healMultiplier); } -void MythicPlus::GroupReset(Group* group, Map* map) { - MpLogger::info(" <<< Group Death Limit reached >>>>"); +void MythicPlus::GroupReset(Group* /*group*/, Map* /* map */) { + // Stubbed out for later implementation }