EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Fix for mob not always facing attacker (https://www.eqemulator.org/forums/showthread.php?t=25860)

Derision 08-03-2008 09:27 AM

Fix for mob not always facing attacker
 
Playing a necro, I've noticed a lot that if a mob is pursuing me, and my pet comes up behind it and engages, although the mob starts attacking my pet, it often doesn't turn to face it. I made this one line addition which seems to have done the trick:

Code:

--- /tmp/EQEmu-0.7.0-1119/zone/MobAI.cpp        2008-05-31 05:12:30.000000000 +0100
+++ MobAI.cpp  2008-08-03 14:13:40.000000000 +0100
@@ -605,20 +605,21 @@
        if (is_combat_range)
        {
                        if (AImovement_timer->Check())
                        {
                                SetRunAnimSpeed(0);
                        }
                        if(IsMoving())
                        {
                                SetMoving(false);
                                moved=false;
+                              SetHeading(CalculateHeadingToTarget(target->GetX(), target->GetY()));
                                /*while(DistNoZ(*target)<10){ //dont want them too close
                                        x_pos -= tar_vx*.2;
                                        y_pos -= tar_vy*.2;
                                        z_pos -= tar_vz*.2;
                                }*/
                                SendPosition();
                                tar_ndx =0;
                        }

                        //casting checked above...



All times are GMT -4. The time now is 04:06 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.