[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.
This commit is contained in:
Alex King 2024-02-24 23:55:40 -05:00 committed by GitHub
parent 8314f2348c
commit 873c128f46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1164,14 +1164,27 @@ int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, in
// check for items being illegally attained // check for items being illegally attained
if (weapon_item) { if (weapon_item) {
if (!weapon_item->GetItem()) if (!weapon_item->GetItem()) {
return 0; return 0;
}
if (weapon_item->GetItemRequiredLevel(true) > GetLevel()) if (weapon_item->GetItemRequiredLevel(true) > GetLevel()) {
return 0; return 0;
}
if (!weapon_item->IsEquipable(GetBaseRace(), GetClass())) if (!weapon_item->IsClassEquipable(GetClass())) {
return 0; return 0;
}
if (
!weapon_item->IsRaceEquipable(GetBaseRace()) &&
(
!IsBot() ||
(IsBot() && !RuleB(Bots, AllowBotEquipAnyRaceGear))
)
) {
return 0;
}
} }
if (against->GetSpecialAbility(IMMUNE_MELEE_NONMAGICAL)) { if (against->GetSpecialAbility(IMMUNE_MELEE_NONMAGICAL)) {
@ -4074,7 +4087,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
if (IsClient()) { if (IsClient()) {
CommonBreakInvisible(); CommonBreakInvisible();
} }
damage = ReduceDamage(damage); damage = ReduceDamage(damage);
LogCombat("Melee Damage reduced to [{}]", damage); LogCombat("Melee Damage reduced to [{}]", damage);
damage = ReduceAllDamage(damage); damage = ReduceAllDamage(damage);