Add weapon check for OH

This commit is contained in:
Bobblybook 2024-07-17 01:10:52 +10:00 committed by GitHub
parent 936fa40a62
commit 228e79ac87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,15 +34,15 @@ bool ShamanWeaponTrigger::IsActive()
*/ */
bool MainHandWeaponNoImbueTrigger::IsActive() { bool MainHandWeaponNoImbueTrigger::IsActive() {
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND ); Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)) if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
return false; return false;
return true; return true;
} }
bool OffHandWeaponNoImbueTrigger::IsActive() { bool OffHandWeaponNoImbueTrigger::IsActive() {
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND ); Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)) if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT) || itemForSpell->GetTemplate()->InventoryType != INVTYPE_WEAPONOFFHAND)
return false; return false;
return true; return true;
} }