[Bug Fix] Stop skill ups on Charmed NPCs. (#2249)

- Clients were capable of leveling up their melee skills on Charmed Mobs according to: https://github.com/EQEmu/Server/issues/2182
This commit is contained in:
Kinglykrab
2022-06-09 21:08:50 -04:00
committed by GitHub
parent 4639405fdf
commit 83e066bffc
3 changed files with 7 additions and 9 deletions
+4 -4
View File
@@ -330,7 +330,7 @@ bool Client::Process() {
{
if (ranged->GetItem() && ranged->GetItem()->ItemType == EQ::item::ItemTypeBow) {
if (ranged_timer.Check(false)) {
if (GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient())) {
if (GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient()) && IsAttackAllowed(GetTarget())) {
if (GetTarget()->InFrontMob(this, GetTarget()->GetX(), GetTarget()->GetY())) {
if (CheckLosFN(GetTarget())) {
//client has built in los check, but auto fire does not.. done last.
@@ -350,7 +350,7 @@ bool Client::Process() {
}
else if (ranged->GetItem() && (ranged->GetItem()->ItemType == EQ::item::ItemTypeLargeThrowing || ranged->GetItem()->ItemType == EQ::item::ItemTypeSmallThrowing)) {
if (ranged_timer.Check(false)) {
if (GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient())) {
if (GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient()) && IsAttackAllowed(GetTarget())) {
if (GetTarget()->InFrontMob(this, GetTarget()->GetX(), GetTarget()->GetY())) {
if (CheckLosFN(GetTarget())) {
//client has built in los check, but auto fire does not.. done last.
@@ -411,7 +411,7 @@ bool Client::Process() {
else if (!los_status || !los_status_facing) {
//you can't see your target
}
else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP
else if (auto_attack_target->GetHP() > -10 && IsAttackAllowed(auto_attack_target)) // -10 so we can watch people bleed in PvP
{
EQ::ItemInstance *wpn = GetInv().GetItem(EQ::invslot::slotPrimary);
TryCombatProcs(wpn, auto_attack_target, EQ::invslot::slotPrimary);
@@ -456,7 +456,7 @@ bool Client::Process() {
{
//you can't see your target
}
else if (auto_attack_target->GetHP() > -10) {
else if (auto_attack_target->GetHP() > -10 && IsAttackAllowed(auto_attack_target)) {
CheckIncreaseSkill(EQ::skills::SkillDualWield, auto_attack_target, -10);
if (CheckDualWield()) {
EQ::ItemInstance *wpn = GetInv().GetItem(EQ::invslot::slotSecondary);