diff options
author | Shauren <shauren.trinity@gmail.com> | 2022-01-23 20:31:52 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 20:31:52 +0100 |
commit | 596bf2b77218e6b959c1bf7de848c6f09d5a91f0 (patch) | |
tree | a129c1cf5e01ce8ba04d70348a01790b14105bf2 /src/server/game/BattlePets/BattlePetMgr.cpp | |
parent | 770fbcca0cae18faac981a326d73996afc20b9ba (diff) |
Core/Misc: Replace boost::optional with std::optional part 2
Diffstat (limited to 'src/server/game/BattlePets/BattlePetMgr.cpp')
-rw-r--r-- | src/server/game/BattlePets/BattlePetMgr.cpp | 6 |
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; |