diff --git a/apps/openmw/mwmp/DedicatedActor.cpp b/apps/openmw/mwmp/DedicatedActor.cpp index 302da0b82..b49cc6dce 100644 --- a/apps/openmw/mwmp/DedicatedActor.cpp +++ b/apps/openmw/mwmp/DedicatedActor.cpp @@ -227,9 +227,9 @@ void DedicatedActor::playSound() bool DedicatedActor::hasItem(std::string refId, int charge) { - for (const auto &ptr : ptr.getClass().getInventoryStore(ptr)) + for (const auto &item : ptr.getClass().getInventoryStore(ptr)) { - if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge) + if (::Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), refId) && item.getCellRef().getCharge() == charge) return true; } @@ -238,9 +238,9 @@ 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 &item : ptr.getClass().getInventoryStore(ptr)) { - if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge) + if (::Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), refId) && item.getCellRef().getCharge() == charge) { std::shared_ptr action = ptr.getClass().use(ptr); action->execute(this->ptr); diff --git a/components/openmw-mp/Base/BasePacketProcessor.hpp b/components/openmw-mp/Base/BasePacketProcessor.hpp index 88dd641b2..120c4e140 100644 --- a/components/openmw-mp/Base/BasePacketProcessor.hpp +++ b/components/openmw-mp/Base/BasePacketProcessor.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #define BPP_INIT(packet_id) packetID = packet_id; strPacketID = #packet_id; className = typeid(this).name(); avoidReading = false; @@ -38,7 +39,7 @@ public: throw std::logic_error("processor " + p.second->strPacketID + " already registered. Check " + processor->className + " and " + p.second->className); } - processors.insert(typename processors_t::value_type(processor->GetPacketID(), std::move(processor))); + processors.emplace(processor->GetPacketID(), std::unique_ptr(processor)); } protected: unsigned char packetID;