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