From 4d0072a74c94aef2a0c0bb18f9599d0d45319601 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 9 Dec 2017 15:04:09 +0800 Subject: [PATCH] [Server] Use foreach loop --- apps/openmw-mp/Inventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw-mp/Inventory.cpp b/apps/openmw-mp/Inventory.cpp index dc701865e..77fa74329 100644 --- a/apps/openmw-mp/Inventory.cpp +++ b/apps/openmw-mp/Inventory.cpp @@ -129,8 +129,8 @@ void Inventory::removeItem(const std::string &refId, unsigned short count) bool Inventory::hasItemEquipped(const std::string &refId) const { - for (int slot = 0; slot < MWWorld::InventoryStore::Slots; slot++) - if (Misc::StringUtils::ciEqual(netActor->getNetCreature()->equipmentItems[slot].refId, refId)) + for (const auto &equipmentItem : netActor->getNetCreature()->equipmentItems) + if (Misc::StringUtils::ciEqual(equipmentItem.refId, refId)) return true; return false; }