mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-06 07:51:35 +00:00
[Client] Fix conditions for sending PlayerItemUse packet for magic items
Previously, attempting to switch to a magic item's spell via a quick key did not work if the item was already equipped.
This commit is contained in:
parent
1a000bc0a8
commit
06dfbe4aec
1 changed files with 6 additions and 7 deletions
|
@ -514,22 +514,21 @@ namespace MWGui
|
||||||
Instead of unilaterally using an item, send an ID_PLAYER_ITEM_USE packet and let the server
|
Instead of unilaterally using an item, send an ID_PLAYER_ITEM_USE packet and let the server
|
||||||
decide if the item actually gets used
|
decide if the item actually gets used
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
if (!item.getClass().getEquipmentSlots(item).first.empty() && !store.isEquipped(item))
|
if (!item.getClass().getEquipmentSlots(item).first.empty() && !store.isEquipped(item))
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
|
||||||
MWBase::Environment::get().getWindowManager()->useItem(item);
|
MWBase::Environment::get().getWindowManager()->useItem(item);
|
||||||
|
|
||||||
// make sure that item was successfully equipped
|
// make sure that item was successfully equipped
|
||||||
if (!store.isEquipped(item))
|
if (!store.isEquipped(item))
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
store.setSelectedEnchantItem(it);
|
||||||
|
MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Spell);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mwmp::Main::get().getLocalPlayer()->sendItemUse(item, true, MWMechanics::DrawState_Spell);
|
mwmp::Main::get().getLocalPlayer()->sendItemUse(item, true, MWMechanics::DrawState_Spell);
|
||||||
}
|
|
||||||
|
|
||||||
//store.setSelectedEnchantItem(it);
|
|
||||||
//MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Spell);
|
|
||||||
/*
|
/*
|
||||||
End of tes3mp change (major)
|
End of tes3mp change (major)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue