Moved pet target checking to the attack command, which is more live like

Also, probably a little better than attacking then backing off :P
This commit is contained in:
Michael Cook 2014-01-07 17:02:35 -05:00
parent e7032bc2c2
commit 8a04d8e2b7
2 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 01/07/2014 ==
demonstar55: Moved pet can attack check to before it tries to attack, which is more live like.
== 01/03/2014 ==
demonstar55: Crash prevention for emote.

View File

@ -7019,7 +7019,13 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
Message_StringID(10, CANNOT_WAKE, mypet->GetCleanName(), GetTarget()->GetCleanName());
break;
}
if (mypet->IsFeared()) break; //prevent pet from attacking stuff while feared
if (mypet->IsFeared())
break; //prevent pet from attacking stuff while feared
if (!mypet->IsAttackAllowed(GetTarget())) {
mypet->Say_StringID(NOT_LEGAL_TARGET);
break;
}
if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 2) || mypet->GetPetType() != petAnimation) {
if (GetTarget() != this && mypet->DistNoRootNoZ(*GetTarget()) <= (RuleR(Pets, AttackCommandRange)*RuleR(Pets, AttackCommandRange))) {