mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-30 16:45:17 -04:00
[Client] Add items required for item magic casting when they are missing
This commit is contained in:
parent
433a69a588
commit
d83160523f
@ -393,18 +393,14 @@ 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())
|
||||||
inventoryStore.setSelectedEnchantItem(it);
|
it = attacker.getClass().getContainerStore(attacker).add(attack.itemId, 1, attacker);
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "- itemId: %s", attack.itemId.c_str());
|
|
||||||
MWBase::Environment::get().getWorld()->castSpell(attacker);
|
inventoryStore.setSelectedEnchantItem(it);
|
||||||
inventoryStore.setSelectedEnchantItem(inventoryStore.end());
|
LOG_APPEND(Log::LOG_VERBOSE, "- itemId: %s", attack.itemId.c_str());
|
||||||
}
|
MWBase::Environment::get().getWorld()->castSpell(attacker);
|
||||||
else
|
inventoryStore.setSelectedEnchantItem(inventoryStore.end());
|
||||||
{
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user