I’ve been trying to fix the issue of pets lagging behind but I can’t get VS to break when I press the hotkey that toggles run/walk.
I’ve set breakpoints on SetSpeed() and several others but the only break I get is HandleMovementOpCode() but nowhere does that ever call SetSpeed() or any function related to speed.
I even rewrote this: FollowMovementGenerator::_updateSpeed
if (u.isPet() && u.GetCharmInfo())
{
if (u.GetCharmInfo()->IsReturning() || (u.GetDistance(u.GetCharmerOrOwner()) > PET_FOLLOW_DIST + u.GetMeleeReach()))
{
// Force run for these situations:
// * Pet returning from stay or combat
// * Distance from owner too far (most likely due to lag)
// Note: Distance is arbitrary. Added GetMeleeReach() to allow for some slack.
// This allows pets to catch up even if the owner is walking
//u.SetWalk(false); // doesn't work, pet is already NOT walking
//u.SetSpeed(MOVE_RUN, u.GetSpeed(MOVE_RUN), true); // doesn't work, speed is set to 1.0f
// These have no effect because SetSpeed() gets called from UpdateSpeed() and checks
// this: if (m_speed_rate[mtype] == rate) and because it is equal it exits the function
u.UpdateSpeed(MOVE_RUN,false);
u.UpdateSpeed(MOVE_WALK,false);
u.UpdateSpeed(MOVE_SWIM,false);
}
else
{
// only match owner's speed if pet isn't returning
u.UpdateSpeed(MOVE_RUN,true);
u.UpdateSpeed(MOVE_WALK,true);
u.UpdateSpeed(MOVE_SWIM,true);
}
}
but it doesn’t work (see comments in code). The call to SetSpeed() just sets the pet’s speed to 1.0f which is walking anyway…
Any advice where to begin would be appreciated, thanks.