Jump to content
  • Movement stops completely and never resumes


    Matenia
    • Product: WRobot General Type: Bug Status: Unconfirmed

    In my battlegrounder product, which worked fine for ages now that I'm testing more thoroughly on WotLK, movement sometimes stops entirely and never resumes.
    Sometimes this happens in combat, usually when calling this code (on my own thread):

    WoWPlayer healer = ObjectManager.GetObjectWoWPlayer()
                    .Where(o => o.Reaction == Reaction.Hostile && o.IsAlive && o.IsHealer() && o.GetDistance <= 45)
                    .OrderBy(o => o.GetDistance).FirstOrDefault();
    
                if (healer != null)
                {
                    Fight.StopFight();
                    Thread.Sleep(500);
                    ObjectManager.Me.Target = healer.Guid;
                    Fight.StartFight(healer.Guid);
                    Logging.Write($"[BG] Switching to healer: {healer.Name}");
                }

    Code like this is then ignored (but sometimes this also seems to stop movement. Everything works fine - code is still called. The bot just NEVER moves anymore.
     

    if (_currentLandMarkAction == null || tMapLandmark?.Landmark.X != _currentLandMarkAction.Landmark.X || tMapLandmark?.Landmark.Y != _currentLandMarkAction.Landmark.Y)
                {
                    _currentLandMarkAction = action;
                    Logging.Write("[BG] Go to zone " + _currentLandMarkAction?.Landmark.Name);
                    if (!Me.IsSwimming)
                    {
                        MovementManager.StopMove();
                    }
                }
    
                if (!MovementManager.InMovement && _currentLandMarkAction?.Landmark.Distance > 5)
                {
                    if (!MovementManager.InMovement)
                    {
                        var npoints = new List<Vector3>();
                        npoints.AddRange(PathFinder.FindPath(_currentLandMarkAction?.Landmark?.Position));
                        MovementManager.Go(npoints);
                    }
                }

    When I hit "stop" on the product, it freezes and never stops. If I press pause as well, it unpauses. Seems like a freeze/multi threading issue but I don't understand how?
    Do you have any idea what could cause this? I'm at a loss.



    User Feedback

    Recommended Comments

    Matenia

    Posted

    It's not related to either code snippets - although they both stop working.
    I've determined it only happens with one fightclass. However, the fightclass itself does not touch movement. 

    I think it might be related to Lua because in combat I've gotten the Lua error "stackoverflow, table too big to unpack".

    Matenia

    Posted

    Problem found: I was using Me.ForceIsCast = true and it never actually reset 



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...