[Crash] Fix potential crash in Mob::CommonDamage (#2848)

out of bounds memory access.
This commit is contained in:
Aeadoin 2023-02-09 10:35:51 -05:00 committed by GitHub
parent 9a544650ee
commit 106cb45b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4093,7 +4093,8 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
a->source = 0;
else
a->source = attacker->GetID();
a->type = SkillDamageTypes[skill_used]; // was 0x1c
a->type = (EQ::ValueWithin(skill_used, EQ::skills::Skill1HBlunt, EQ::skills::Skill2HPiercing)) ?
SkillDamageTypes[skill_used] : SkillDamageTypes[EQ::skills::SkillHandtoHand]; // was 0x1c
a->damage = damage;
a->spellid = spell_id;
if (special == eSpecialAttacks::AERampage)