Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2014, 10:14 PM
jdoran
Hill Giant
 
Join Date: Jul 2012
Posts: 212
Default AssignWaypoints skipping a waypoint

I spent most of the day pouring over waypoints and pathing, and came across something interesting. Hopefully this wasn't the result of another local change, but the GIT code looks pretty clear.

At the end of NPC::AssignWaypoints we have the following:
Code:
    } else if(!GridErr && !WPErr) {
        UpdateWaypoint(0);
        SetWaypointPause();
        if (wandertype == 1 || wandertype == 2 || wandertype == 5)
            CalculateNewWaypoint();
    } else {
UpdateWaypoint(0) starts us off on the first waypoint (sets cur_wp).

SetWaypointPause() waits at the current location for the pause (depending on pausetype) to expire. The NPC stands there for a bit... and then CalculateNewWaypoint is called.

Now one might say "wait a minute, that is only for those 3 wandertypes",
but alas there is another path. In AI_DoMovement there is the
following (which occurs when the AIwalking_timer expires):

Code:
                        if(gridno > 0) {
                            CastToNPC()->CalculateNewWaypoint();
Of course the mob has a grid, that is what AssignWaypoints assigned.
And CalculateNewWaypoint moves to the next waypoint and resumes
walking (via UpdateWaypoint at the end).

The effect is to skip over the first waypoint in the grid.

I have had good luck with just removing the pause in AssignWaypoints.
(If I wanted to wait at the current spot, I would have delayed the call
to AssignWaypoints. Personally I want the mob to start moving the
moment it gets a grid. I may be in the minority...)

By removing the pause, the NPC was confirmed to start moving immediately
upon grid assign, and head to the first waypoint on the grid.

Code:
diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp
index e9257d5..f756dc2 100644
--- a/zone/waypoints.cpp
+++ b/zone/waypoints.cpp
@@ -953,7 +953,6 @@ void NPC::AssignWaypoints(int32 grid) {
                roamer = false;
        } else if(!GridErr && !WPErr) {
                UpdateWaypoint(0);
-               SetWaypointPause();
                if (wandertype == 1 || wandertype == 2 || wandertype == 5)
                        CalculateNewWaypoint();
        } else {
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:33 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3