Throw added client los pet checks behind LoS cheat rule for bots

This commit is contained in:
nytmyr
2025-02-02 15:46:42 -06:00
parent 4e6e6f06d6
commit 0690783a9d
+6 -2
View File
@@ -11093,7 +11093,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
if (!target) if (!target)
break; break;
if (!DoLosChecks(target)) { if (CheckLosCheat(target) && !DoLosChecks(target)) {
mypet->SayString(this, NOT_LEGAL_TARGET); mypet->SayString(this, NOT_LEGAL_TARGET);
break; break;
} }
@@ -11107,9 +11107,11 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
break; //prevent pet from attacking stuff while feared break; //prevent pet from attacking stuff while feared
if (!mypet->IsAttackAllowed(target)) { if (!mypet->IsAttackAllowed(target)) {
if (CheckLosCheat(target) && !DoLosChecks(target)) {
mypet->SayString(this, NOT_LEGAL_TARGET); mypet->SayString(this, NOT_LEGAL_TARGET);
break; break;
} }
}
// default range is 200, takes Z into account // default range is 200, takes Z into account
// really they do something weird where they're added to the aggro list then remove them // really they do something weird where they're added to the aggro list then remove them
@@ -11161,7 +11163,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
break; break;
} }
if (!DoLosChecks(GetTarget())) { if (CheckLosCheat(GetTarget()) && !DoLosChecks(GetTarget())) {
mypet->SayString(this, NOT_LEGAL_TARGET); mypet->SayString(this, NOT_LEGAL_TARGET);
break; break;
} }
@@ -11172,9 +11174,11 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
} }
if (!mypet->IsAttackAllowed(GetTarget())) { if (!mypet->IsAttackAllowed(GetTarget())) {
if (CheckLosCheat(GetTarget()) && !DoLosChecks(GetTarget())) {
mypet->SayString(this, NOT_LEGAL_TARGET); mypet->SayString(this, NOT_LEGAL_TARGET);
break; break;
} }
}
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
if (GetTarget() != this && DistanceSquaredNoZ(mypet->GetPosition(), GetTarget()->GetPosition()) <= (RuleR(Pets, AttackCommandRange)*RuleR(Pets, AttackCommandRange))) { if (GetTarget() != this && DistanceSquaredNoZ(mypet->GetPosition(), GetTarget()->GetPosition()) <= (RuleR(Pets, AttackCommandRange)*RuleR(Pets, AttackCommandRange))) {