forked from mirror/openmw-tes3mp
[Cllient] Differentiate itemPtr from actor Ptr in DedicatedActor methods
2427a4f877
mistakenly used the variable name "ptr" for both the actor and the items in that actor's inventory.
This commit is contained in:
parent
b6324e3532
commit
f1315ef30d
1 changed files with 6 additions and 6 deletions
|
@ -341,9 +341,9 @@ void DedicatedActor::playSound()
|
|||
|
||||
bool DedicatedActor::hasItem(std::string refId, int charge)
|
||||
{
|
||||
for (const auto &ptr : ptr.getClass().getInventoryStore(ptr))
|
||||
for (const auto &itemPtr : ptr.getClass().getInventoryStore(ptr))
|
||||
{
|
||||
if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge)
|
||||
if (::Misc::StringUtils::ciEqual(itemPtr.getCellRef().getRefId(), refId) && itemPtr.getCellRef().getCharge() == charge)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -352,12 +352,12 @@ 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 &itemPtr : ptr.getClass().getInventoryStore(ptr))
|
||||
{
|
||||
if (::Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), refId) && ptr.getCellRef().getCharge() == charge)
|
||||
if (::Misc::StringUtils::ciEqual(itemPtr.getCellRef().getRefId(), refId) && itemPtr.getCellRef().getCharge() == charge)
|
||||
{
|
||||
std::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr);
|
||||
action->execute(this->ptr);
|
||||
std::shared_ptr<MWWorld::Action> action = itemPtr.getClass().use(itemPtr);
|
||||
action->execute(ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue