mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
Fix oil issue
This commit is contained in:
@@ -4388,14 +4388,14 @@ Item* PlayerbotAI::FindStoneFor(Item* weapon) const
|
|||||||
return stone;
|
return stone;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint32 uPriorizedWizardOilIds[5] = {MINOR_WIZARD_OIL, LESSER_WIZARD_OIL, BRILLIANT_WIZARD_OIL, WIZARD_OIL,
|
static const std::vector<WizardOilDisplayId> uPriorizedWizardOilIds =
|
||||||
SUPERIOR_WIZARD_OIL};
|
{
|
||||||
|
MINOR_WIZARD_OIL, LESSER_WIZARD_OIL, BRILLIANT_WIZARD_OIL, WIZARD_OIL, SUPERIOR_WIZARD_OIL
|
||||||
|
};
|
||||||
|
|
||||||
static const uint32 uPriorizedManaOilIds[4] = {
|
static const std::vector<ManaOilDisplayId> uPriorizedManaOilIds =
|
||||||
MINOR_MANA_OIL,
|
{
|
||||||
LESSER_MANA_OIL,
|
MINOR_MANA_OIL, LESSER_MANA_OIL, BRILLIANT_MANA_OIL, SUPERIOR_MANA_OIL,
|
||||||
BRILLIANT_MANA_OIL,
|
|
||||||
SUPERIOR_MANA_OIL,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Item* PlayerbotAI::FindOilFor(Item* weapon) const
|
Item* PlayerbotAI::FindOilFor(Item* weapon) const
|
||||||
@@ -4405,25 +4405,22 @@ Item* PlayerbotAI::FindOilFor(Item* weapon) const
|
|||||||
if (pProto && (pProto->SubClass == ITEM_SUBCLASS_WEAPON_SWORD || pProto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF ||
|
if (pProto && (pProto->SubClass == ITEM_SUBCLASS_WEAPON_SWORD || pProto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF ||
|
||||||
pProto->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER))
|
pProto->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER))
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < std::size(uPriorizedWizardOilIds); ++i)
|
for (const auto& id : uPriorizedWizardOilIds)
|
||||||
{
|
{
|
||||||
oil = FindConsumable(uPriorizedWizardOilIds[i]);
|
oil = FindConsumable(uPriorizedWizardOilIds[id]);
|
||||||
if (!oil)
|
if (!oil)
|
||||||
oil = FindConsumable(uPriorizedManaOilIds[i]);
|
oil = FindConsumable(uPriorizedManaOilIds[id]);
|
||||||
|
|
||||||
if (oil)
|
if (oil)
|
||||||
return oil;
|
return oil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pProto &&
|
else if (pProto && (pProto->SubClass == ITEM_SUBCLASS_WEAPON_MACE || pProto->SubClass == ITEM_SUBCLASS_WEAPON_MACE2))
|
||||||
(pProto->SubClass == ITEM_SUBCLASS_WEAPON_MACE || pProto->SubClass == ITEM_SUBCLASS_WEAPON_MACE2))
|
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < std::size(uPriorizedManaOilIds); ++i)
|
for (const auto& id : uPriorizedManaOilIds)
|
||||||
{
|
{
|
||||||
oil = FindConsumable(uPriorizedManaOilIds[i]);
|
oil = FindConsumable(uPriorizedManaOilIds[id]);
|
||||||
if (!oil)
|
if (!oil)
|
||||||
oil = FindConsumable(uPriorizedWizardOilIds[i]);
|
oil = FindConsumable(uPriorizedWizardOilIds[id]);
|
||||||
|
|
||||||
if (oil)
|
if (oil)
|
||||||
return oil;
|
return oil;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user