From f1315ef30d5b86d7a88b37d0996dd48c88e288fa Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 21 Jul 2018 10:16:51 +0300 Subject: [PATCH] [Cllient] Differentiate itemPtr from actor Ptr in DedicatedActor methods 2427a4f877d149e30d9e94adcca38268ebc3fc92 mistakenly used the variable name "ptr" for both the actor and the items in that actor's inventory. --- apps/openmw/mwmp/DedicatedActor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwmp/DedicatedActor.cpp b/apps/openmw/mwmp/DedicatedActor.cpp index 9a118176b..0e4565eef 100644 --- a/apps/openmw/mwmp/DedicatedActor.cpp +++ b/apps/openmw/mwmp/DedicatedActor.cpp @@ -341,9 +341,9 @@ void DedicatedActor::playSound() bool DedicatedActor::hasItem(std::string refId, int charge) { - for (const auto &ptr : ptr.getClass().getInventoryStore(ptr)) + for (const auto &itemPtr : ptr.getClass().getInventoryStore(ptr)) { - if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge) + if (::Misc::StringUtils::ciEqual(itemPtr.getCellRef().getRefId(), refId) && itemPtr.getCellRef().getCharge() == charge) return true; } @@ -352,12 +352,12 @@ bool DedicatedActor::hasItem(std::string refId, int charge) void DedicatedActor::equipItem(std::string refId, int charge) { - for (const auto &ptr : ptr.getClass().getInventoryStore(ptr)) + for (const auto &itemPtr : ptr.getClass().getInventoryStore(ptr)) { - if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge) + if (::Misc::StringUtils::ciEqual(itemPtr.getCellRef().getRefId(), refId) && itemPtr.getCellRef().getCharge() == charge) { - std::shared_ptr action = ptr.getClass().use(ptr); - action->execute(this->ptr); + std::shared_ptr action = itemPtr.getClass().use(itemPtr); + action->execute(ptr); break; } }