From 873c128f46e3284575a36a4a54e86ad79fde7f45 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Sat, 24 Feb 2024 23:55:40 -0500 Subject: [PATCH] [Bug Fix] Fix Bot Weapons with No Races (#4110) # Notes - Bot weapons that have no races were not causing damage and saying the target was invulnerable because we were not checking the `Bots:AllowBotEquipAnyRaceGear` rule. --- zone/attack.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index a276f4d85..66cdbd3ad 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1164,14 +1164,27 @@ int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, in // check for items being illegally attained if (weapon_item) { - if (!weapon_item->GetItem()) + if (!weapon_item->GetItem()) { return 0; + } - if (weapon_item->GetItemRequiredLevel(true) > GetLevel()) + if (weapon_item->GetItemRequiredLevel(true) > GetLevel()) { return 0; + } - if (!weapon_item->IsEquipable(GetBaseRace(), GetClass())) + if (!weapon_item->IsClassEquipable(GetClass())) { return 0; + } + + if ( + !weapon_item->IsRaceEquipable(GetBaseRace()) && + ( + !IsBot() || + (IsBot() && !RuleB(Bots, AllowBotEquipAnyRaceGear)) + ) + ) { + return 0; + } } if (against->GetSpecialAbility(IMMUNE_MELEE_NONMAGICAL)) { @@ -4074,7 +4087,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons if (IsClient()) { CommonBreakInvisible(); } - + damage = ReduceDamage(damage); LogCombat("Melee Damage reduced to [{}]", damage); damage = ReduceAllDamage(damage);