[Bug Fix] Attack Corpse Skill Up Fix (#3924)

* [Bug] Attack Corpse Skillup Fix

Occasions where a corpse will allow skillups from attacks being turned on (even if no damage)

* requested changes
This commit is contained in:
Fryguy 2024-01-08 23:32:18 -05:00 committed by GitHub
parent f12c87a04a
commit 0418dc4aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1463,9 +1463,9 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts, boo
//SYNC WITH: tune.cpp, mob.h TuneClientAttack
bool Mob::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts)
{
if (!other) {
if (!other || (other && other->IsCorpse())) {
SetTarget(nullptr);
LogError("A null Mob object was passed for evaluation!");
LogError("A null or invalid Mob object was passed for evaluation!");
return false;
}
@ -6322,8 +6322,9 @@ void NPC::SetAttackTimer()
void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
{
if (!target)
if (!target || (target && target->IsCorpse())) {
return;
}
Attack(target, hand, false, false, IsFromSpell);