mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-01 04:21:34 +00:00
[Client] Update DedicatedActor to C++11
This commit is contained in:
parent
8f7da49152
commit
2427a4f877
1 changed files with 6 additions and 14 deletions
|
@ -178,9 +178,7 @@ void DedicatedActor::setEquipment()
|
|||
storeRefId = it->getCellRef().getRefId();
|
||||
|
||||
if (!Misc::StringUtils::ciEqual(storeRefId, packetRefId)) // if other item equiped
|
||||
{
|
||||
invStore.unequipSlot(slot, ptr);
|
||||
}
|
||||
else
|
||||
equal = true;
|
||||
}
|
||||
|
@ -227,14 +225,10 @@ void DedicatedActor::playSound()
|
|||
|
||||
bool DedicatedActor::hasItem(std::string refId, int charge)
|
||||
{
|
||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
|
||||
|
||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
||||
for (const auto &ptr : ptr.getClass().getInventoryStore(ptr))
|
||||
{
|
||||
if (::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), refId) && it->getCellRef().getCharge() == charge)
|
||||
{
|
||||
if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -242,14 +236,12 @@ bool DedicatedActor::hasItem(std::string refId, int charge)
|
|||
|
||||
void DedicatedActor::equipItem(std::string refId, int charge)
|
||||
{
|
||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
|
||||
|
||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
||||
for (const auto &ptr : ptr.getClass().getInventoryStore(ptr))
|
||||
{
|
||||
if (::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), refId) && it->getCellRef().getCharge() == charge)
|
||||
if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge)
|
||||
{
|
||||
std::shared_ptr<MWWorld::Action> action = it->getClass().use(*it);
|
||||
action->execute(ptr);
|
||||
std::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr);
|
||||
action->execute(this->ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue