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) { 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) { 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 |
All times are GMT -4. The time now is 07:48 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.