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.
Recommended Comments
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 accountSign in
Already have an account? Sign in here.
Sign In Now