mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 16:11:37 -04:00
[Client] Update DedicatedActor to C++11
This commit is contained in:
parent
8f7da49152
commit
2427a4f877
@ -178,9 +178,7 @@ void DedicatedActor::setEquipment()
|
|||||||
storeRefId = it->getCellRef().getRefId();
|
storeRefId = it->getCellRef().getRefId();
|
||||||
|
|
||||||
if (!Misc::StringUtils::ciEqual(storeRefId, packetRefId)) // if other item equiped
|
if (!Misc::StringUtils::ciEqual(storeRefId, packetRefId)) // if other item equiped
|
||||||
{
|
|
||||||
invStore.unequipSlot(slot, ptr);
|
invStore.unequipSlot(slot, ptr);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
equal = true;
|
equal = true;
|
||||||
}
|
}
|
||||||
@ -227,14 +225,10 @@ void DedicatedActor::playSound()
|
|||||||
|
|
||||||
bool DedicatedActor::hasItem(std::string refId, int charge)
|
bool DedicatedActor::hasItem(std::string refId, int charge)
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
|
for (const auto &ptr : ptr.getClass().getInventoryStore(ptr))
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
|
||||||
{
|
{
|
||||||
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 true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -242,14 +236,12 @@ bool DedicatedActor::hasItem(std::string refId, int charge)
|
|||||||
|
|
||||||
void DedicatedActor::equipItem(std::string refId, int charge)
|
void DedicatedActor::equipItem(std::string refId, int charge)
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
|
for (const auto &ptr : ptr.getClass().getInventoryStore(ptr))
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
|
||||||
{
|
{
|
||||||
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);
|
std::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr);
|
||||||
action->execute(ptr);
|
action->execute(this->ptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user