mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:49:58 +00:00
Do not allow to unequip weapon from inventory during attack
This commit is contained in:
parent
6f22d819c5
commit
91dcd5bc6e
1 changed files with 13 additions and 0 deletions
|
@ -255,6 +255,19 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
// If we unequip weapon during attack, it can lead to unexpected behaviour
|
||||
if (MWBase::Environment::get().getMechanicsManager()->isAttackingOrSpell(mPtr))
|
||||
{
|
||||
bool isWeapon = item.mBase.getTypeName() == typeid(ESM::Weapon).name();
|
||||
MWWorld::InventoryStore& invStore = mPtr.getClass().getInventoryStore(mPtr);
|
||||
|
||||
if (isWeapon && invStore.isEquipped(item.mBase))
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sCantEquipWeapWarning}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (count > 1 && !shift)
|
||||
{
|
||||
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
||||
|
|
Loading…
Reference in a new issue