aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-03-13 18:51:29 +0100
committerShauren <shauren.trinity@gmail.com>2024-03-13 18:51:29 +0100
commit4779fa5048642b57a0f69de7ab56b9d563c1cbc4 (patch)
tree9bd8f8daccb5d3e7f8e98c3556db8f3c9b204460 /src/server/scripts/Commands
parent18200e1b88596dbead10d0b8ecbd10557db43323 (diff)
Core/Misc: Use our new unique_trackable_ptr for various classes exposed to scripts (not actually used anywhere currently)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp4
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp4
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp18
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 cfd9b4fd99a..4a6fbd0fb38 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -684,17 +684,17 @@ public:
if (handler->GetSession())
{
int32 maxLevel = 0;
- if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second.GetContentTuningId(),
+ if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second->GetContentTuningId(),
handler->GetSession()->GetPlayer()->m_playerData->CtrOptions->ContentTuningConditionMask))
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);
}
@@ -709,7 +709,7 @@ public:
}
}
- std::string title = questTemplatePair.second.GetLogTitle();
+ std::string title = questTemplatePair.second->GetLogTitle();
if (title.empty())
continue;
@@ -744,17 +744,17 @@ public:
if (handler->GetSession())
{
int32 maxLevel = 0;
- if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second.GetContentTuningId(),
+ if (Optional<ContentTuningLevels> questLevels = sDB2Manager.GetContentTuningData(questTemplatePair.second->GetContentTuningId(),
handler->GetSession()->GetPlayer()->m_playerData->CtrOptions->ContentTuningConditionMask))
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);
}