Fix build for gcc-5.4.0

This commit is contained in:
Kyle Cooley 2018-01-04 21:41:00 -05:00
parent e2103d0bea
commit fcd4d8b842
2 changed files with 6 additions and 5 deletions

View file

@ -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<MWWorld::Action> action = ptr.getClass().use(ptr);
action->execute(this->ptr);

View file

@ -8,6 +8,7 @@
#include <string>
#include <memory>
#include <unordered_map>
#include <utility>
#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<Proccessor>(processor));
}
protected:
unsigned char packetID;