From b8be979456facdfb83db0a09543795e152bb9cc6 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Wed, 13 Sep 2023 22:35:23 -0300 Subject: [PATCH] fix: shadows outer variable --- src/creatures/players/player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 32899cc517e..339b26cfc0b 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1140,8 +1140,8 @@ std::shared_ptr Player::getDepotLocker(uint32_t depotId) { depotBox->setParent(depotChest); inbox->setParent(depotLocker); - if (std::shared_ptr depotBox = getDepotChest(i, false)) { - depotBox->setParent(depotLocker->getItemByIndex(0)->getContainer()); + if (auto depotChestCache = getDepotChest(i, false)) { + depotChestCache->setParent(depotLocker->getItemByIndex(0)->getContainer()); } } depotLocker->internalAddThing(depotChest);