Cleanup bot logic in TryBackstab

This commit is contained in:
nytmyr
2025-02-02 08:42:02 -06:00
parent a3085be4c3
commit b57be45b51
+7 -11
View File
@@ -727,19 +727,15 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
} }
} }
else if (IsBot()) { else if (IsBot()) {
const EQ::ItemInstance* inst = CastToBot()->GetBotItem(EQ::invslot::slotPrimary); auto bot = CastToBot();
const EQ::ItemData* botpiercer = nullptr; auto inst = bot->GetBotItem(EQ::invslot::slotPrimary);
auto bot_piercer = inst ? inst->GetItem() : nullptr;
if (inst) { if (!bot_piercer || bot_piercer->ItemType != EQ::item::ItemType1HPiercing) {
botpiercer = inst->GetItem(); if (!bot->GetCombatRoundForAlerts()) {
bot->SetCombatRoundForAlerts();
bot->RaidGroupSay(this, "I can't backstab with this weapon!");
} }
if (!botpiercer || (botpiercer->ItemType != EQ::item::ItemType1HPiercing)) {
if (!CastToBot()->GetCombatRoundForAlerts()) {
CastToBot()->SetCombatRoundForAlerts();
CastToBot()->RaidGroupSay(this, "I can't backstab with this weapon!");
}
return; return;
} }
} }