aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/BattlePets/BattlePetMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/BattlePets/BattlePetMgr.cpp')
-rw-r--r--src/server/game/BattlePets/BattlePetMgr.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/server/game/BattlePets/BattlePetMgr.cpp b/src/server/game/BattlePets/BattlePetMgr.cpp
index a8e730e0b6b..57d8d4ea0de 100644
--- a/src/server/game/BattlePets/BattlePetMgr.cpp
+++ b/src/server/game/BattlePets/BattlePetMgr.cpp
@@ -492,7 +492,7 @@ void BattlePetMgr::ClearFanfare(ObjectGuid guid)
pet->SaveInfo = BATTLE_PET_CHANGED;
}
-void BattlePetMgr::ModifyName(ObjectGuid guid, std::string const& name, DeclinedName* declinedName)
+void BattlePetMgr::ModifyName(ObjectGuid guid, std::string const& name, std::unique_ptr<DeclinedName> declinedName)
{
if (!HasJournalLock())
return;
@@ -504,9 +504,7 @@ void BattlePetMgr::ModifyName(ObjectGuid guid, std::string const& name, Declined
pet->PacketInfo.Name = name;
pet->NameTimestamp = GameTime::GetGameTime();
- pet->DeclinedName.reset();
- if (declinedName)
- pet->DeclinedName = std::make_unique<DeclinedName>(*declinedName);
+ pet->DeclinedName = std::move(declinedName);
if (pet->SaveInfo != BATTLE_PET_NEW)
pet->SaveInfo = BATTLE_PET_CHANGED;