Code: Pet agro fix (well, if it was broken)
I noticed my pets weren't attacking critters that attacked me, so I made a small change to attack.cpp (highlighted below).
Code:
// Agro the client's pet if it has one. |
FYI - that attack.cpp is from the 4.1 distribution and looks to be out of sync with the CVS.
|
k I merged it for you, gj.
|
and i just removed it again, it was in the wrong function :-/
you not only need to check for NPC melee attacks but spell attacks too, and you'd miss them in NPC::Attack. so i put it where it belongs (Client::Damage) good point about clients being charmed pets too - i would have missed that, but since i didn't put charm as possible offensive spell it wouldnt matter until someone changed the NPC behavior code. |
Oh yeah. :oops:
|
Yeah, that makes more sense to make sure special attacks are considered. Which reminds me, I've noticed in 0.4.1 that NPCs do not agro if special attacked by a PC. Perhaps a line needs to be moved from Client::Attack to NPC::Damage?
But that begs the question, what about agro on misses? I'm really new to the code base but, ::Damage isn't called if you miss, right? If that is the case, then should AddToHateList be added to all attack methods (using a low hate of zero or 1)? |
All times are GMT -4. The time now is 02:17 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.