diff options
| author | Shauren <shauren.trinity@gmail.com> | 2024-03-13 18:51:29 +0100 |
|---|---|---|
| committer | funjoker <funjoker109@gmail.com> | 2024-03-25 20:21:24 +0100 |
| commit | 64724464407e5b7646a48e6a5191d6fd8997ac77 (patch) | |
| tree | c2ddc8dcdfc7032e9d60fb59735895b388c0b096 /src/server/scripts/Commands | |
| parent | 382d67622fc9b4ec7eeb9e3f8bd56876133901fd (diff) | |
Core/Misc: Use our new unique_trackable_ptr for various classes exposed to scripts (not actually used anywhere currently)
(cherry picked from commit 4779fa5048642b57a0f69de7ab56b9d563c1cbc4)
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_guild.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_learn.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_lookup.cpp | 18 |
3 files changed, 12 insertions, 14 deletions
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp index c824e370632..1518d0b5422 100644 --- a/src/server/scripts/Commands/cs_guild.cpp +++ b/src/server/scripts/Commands/cs_guild.cpp @@ -143,8 +143,6 @@ public: return false; targetGuild->Disband(); - delete targetGuild; - return true; } @@ -192,7 +190,7 @@ public: return false; CharacterDatabaseTransaction trans(nullptr); - targetGuild->DeleteMember(trans, targetGuid, false, true, true); + targetGuild->DeleteMember(trans, targetGuid, false, true); return true; } diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 2986bb3ce13..2bbcf492c4a 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -135,8 +135,8 @@ public: Player* player = handler->GetPlayer(); for (auto const& [id, quest] : sObjectMgr->GetQuestTemplates()) { - if (quest.GetAllowableClasses() && player->SatisfyQuestClass(&quest, false)) - player->LearnQuestRewardedSpells(&quest); + if (quest->GetAllowableClasses() && player->SatisfyQuestClass(quest.get(), false)) + player->LearnQuestRewardedSpells(quest.get()); } return true; } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 354820cb2ec..e2e62eb3373 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -684,16 +684,16 @@ public: if (handler->GetSession()) { int32 maxLevel = 0; - if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second.GetContentTuningId(), 0)) + if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second->GetContentTuningId(), 0)) maxLevel = questLevels->MaxLevel; int32 scalingFactionGroup = 0; - if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(questTemplatePair.second.GetContentTuningId())) + if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(questTemplatePair.second->GetContentTuningId())) scalingFactionGroup = contentTuning->GetScalingFactionGroup(); handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, - handler->GetSession()->GetPlayer()->GetQuestLevel(&questTemplatePair.second), - handler->GetSession()->GetPlayer()->GetQuestMinLevel(&questTemplatePair.second), + handler->GetSession()->GetPlayer()->GetQuestLevel(questTemplatePair.second.get()), + handler->GetSession()->GetPlayer()->GetQuestMinLevel(questTemplatePair.second.get()), maxLevel, scalingFactionGroup, title.c_str(), statusStr); } @@ -708,7 +708,7 @@ public: } } - std::string title = questTemplatePair.second.GetLogTitle(); + std::string title = questTemplatePair.second->GetLogTitle(); if (title.empty()) continue; @@ -743,16 +743,16 @@ public: if (handler->GetSession()) { int32 maxLevel = 0; - if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second.GetContentTuningId(), 0)) + if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second->GetContentTuningId(), 0)) maxLevel = questLevels->MaxLevel; int32 scalingFactionGroup = 0; - if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(questTemplatePair.second.GetContentTuningId())) + if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(questTemplatePair.second->GetContentTuningId())) scalingFactionGroup = contentTuning->GetScalingFactionGroup(); handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, - handler->GetSession()->GetPlayer()->GetQuestLevel(&questTemplatePair.second), - handler->GetSession()->GetPlayer()->GetQuestMinLevel(&questTemplatePair.second), + handler->GetSession()->GetPlayer()->GetQuestLevel(questTemplatePair.second.get()), + handler->GetSession()->GetPlayer()->GetQuestMinLevel(questTemplatePair.second.get()), maxLevel, scalingFactionGroup, title.c_str(), statusStr); } |
