Fix build for gcc-5.4.0

sol2-server-rewrite
Kyle Cooley 7 years ago
parent e2103d0bea
commit fcd4d8b842

@ -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);

@ -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;

Loading…
Cancel
Save