forked from teamnwah/openmw-tes3coop
[Client] Add items required for item magic casting when they are missing
This commit is contained in:
parent
433a69a588
commit
d83160523f
1 changed files with 8 additions and 12 deletions
|
@ -393,19 +393,15 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it != inventoryStore.end())
|
// Add the item if it's missing
|
||||||
{
|
if (it == inventoryStore.end())
|
||||||
|
it = attacker.getClass().getContainerStore(attacker).add(attack.itemId, 1, attacker);
|
||||||
|
|
||||||
inventoryStore.setSelectedEnchantItem(it);
|
inventoryStore.setSelectedEnchantItem(it);
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "- itemId: %s", attack.itemId.c_str());
|
LOG_APPEND(Log::LOG_VERBOSE, "- itemId: %s", attack.itemId.c_str());
|
||||||
MWBase::Environment::get().getWorld()->castSpell(attacker);
|
MWBase::Environment::get().getWorld()->castSpell(attacker);
|
||||||
inventoryStore.setSelectedEnchantItem(inventoryStore.end());
|
inventoryStore.setSelectedEnchantItem(inventoryStore.end());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Could not find item %s used by %s to cast item spell!",
|
|
||||||
attack.itemId.c_str(), attacker.getCellRef().getRefId().c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MechanicsHelper::doesEffectListContainEffect(const ESM::EffectList& effectList, short effectId, short attributeId, short skillId)
|
bool MechanicsHelper::doesEffectListContainEffect(const ESM::EffectList& effectList, short effectId, short attributeId, short skillId)
|
||||||
|
|
Loading…
Reference in a new issue