Lady-Binary / EasyLoU

EasyLoU is the premiere macro tool for Legends of Aria / Legends of Ultima. It is a totally free and open source tool inspired by EasyUO, the popular premiere macroing tool for Ultima Online.
Other
10 stars 12 forks source link

Fix issue with FindMobile not working in some cases #154

Closed Factorial-Prime closed 3 years ago

Factorial-Prime commented 3 years ago

Describe the bug Sometimes FindMobile stops working where the FINDMOBILE variable never gets updated

To Reproduce Steps to reproduce the behavior. I'm not entirely sure how to reproduce but it's usually after I've been running EasyLoU for awhile ( a few hours ) The only way I've found to fix it is to close both LoA and EasyLoA and start over

Expected behavior FindMobile function always updates the FINDMOBILE variable

Screenshots

Desktop (please complete the following information):

Additional context Here's some logs I've noticed in Player.log

2021-01-27T03:37:35.4461815Z - LoU - Command found 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

2021-01-27T03:37:35.4461815Z - LoU - New command FindMobile received at 1611718655275! Params: 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

2021-01-27T03:37:35.4461815Z - LoU - Error processing client command: System.NullReferenceException
  at (wrapper managed-to-native) UnityEngine.Component.get_transform(UnityEngine.Component)
  at ClientObjectManager+HFMJEGNDBIK.MoveNext () [0x0008c] in <26fad0ae1ff94f1194542e1b3454fa86>:0 
  at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Int32& length) [0x00032] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at System.Linq.Buffer`1[TElement]..ctor (System.Collections.Generic.IEnumerable`1[T] source) [0x00022] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at System.Linq.OrderedEnumerable`1+<GetEnumerator>d__3[TElement].MoveNext () [0x0001e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at LoU.Utils.FindMobile (System.String name, System.Single distance) [0x000c9] in <a0466afb463a4037b631c26ec9453b88>:0 
  at LoU.Utils.FindMobile (System.String name) [0x00000] in <a0466afb463a4037b631c26ec9453b88>:0 
  at LoU.Worker.ProcessClientCommand (LoU.ClientCommand ClientCommand) [0x01cc5] in <a0466afb463a4037b631c26ec9453b88>:0 
  at LoU.Worker.Update () [0x00225] in <a0466afb463a4037b631c26ec9453b88>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

2021-01-27T03:37:35.4461815Z - LoU - Error building NEARBYMONSTERS! 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

2021-01-27T03:37:35.4461815Z - LoU - System.NullReferenceException
  at (wrapper managed-to-native) UnityEngine.Component.get_transform(UnityEngine.Component)
  at ClientObjectManager+HFMJEGNDBIK.MoveNext () [0x0008c] in <26fad0ae1ff94f1194542e1b3454fa86>:0 
  at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].ToArray () [0x0003e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at LoU.Worker.UpdateClientStatus () [0x00d48] in <a0466afb463a4037b631c26ec9453b88>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
Factorial-Prime commented 3 years ago

If it helps I'm running a combination of FindMobile with ID's and Strings

Lady-Binary commented 3 years ago

Ok, I wasn't really able to reproduce. I suspect there was a specific Mobile that you had around you that was causing this.

I've added a bunch of sanity checks that should prevent this from happening.

Or better, when this will happen, shouldn't crash the update method and should keep running as usual.

Will be in the next release.