Jump to content

Matenia

Elite user
  • Posts

    2226
  • Joined

  • Last visited

Bug Report Comments posted by Matenia

  1. For testing, I tried using this code (calling start and stop from a plugin).
    But nothing is ever logged, so I think ObjectManager.Me.InCombat is incorrectly returning false. It should be the same as this.

     

    public static bool AffectingCombat(this WoWLocalPlayer me)
    {
      return Lua.LuaDoString<bool>(@"return (UnitAffectingCombat(""player"") ~= nil)");
    }
    public class RegenStop
    {
    
        private static WoWLocalPlayer Me = ObjectManager.Me;
        private static Engine engine;
        private static Regeneration regeneration = new Regeneration();
    
        public static void Start()
        {
            FiniteStateMachineEvents.OnStartEngine += (Engine engine) => {
                RegenStop.engine = engine;
            };
            FiniteStateMachineEvents.OnRunState += AntiRegenEventHandler;
            FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += AntiRegenEventHandler;
        }
    
        public static void Stop()
        {
            FiniteStateMachineEvents.OnRunState -= AntiRegenEventHandler;
            FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState -= AntiRegenEventHandler;
        }
    
        private static void AntiRegenEventHandler(Engine engine, State state, CancelEventArgs cancelable)
        {
            if (state.DisplayName == "Regeneration" && Me.InCombat)
            {
    
                Logging.WriteDebug("cancelling regen while in combat");
                cancelable.Cancel = true;
    
                RegenStop.engine.RemoveStateByName("Regeneration");
                ReenableRegen();
            }
        }
    
        private static async void ReenableRegen()
        {
            await Task.Delay(10000);
            engine.AddState(regeneration);
        }
    }

     

  2. Example screenshot of this: 

    kENkfsx.jpg

    Quote

    [D] 10:54:43 - successfully casted: Ice Barrier
    10:54:44 - [Regen] Use drink Conjured Sparkling Water
    10:54:58 - [Regen] Finished
    10:54:59 - [Fight] Player attack before being attacked by Rock Stalker (lvl 58)
    [D] 10:55:30 - [MovementManager] Avoid wall: StrafeLeft
    [D] 10:55:32 - [MovementManager] Current pos: -7508,243 ; 1112,508 ; -1,46689 ; "None" - Target pos: -7504,142 ; 1107,832 ; -0,9357554 ; "None" Continent: Kalimdor Tile: 29.91405_46.07796
    [D] 10:55:32 - [StuckResolver] Started.
    [D] 10:55:35 - [StuckResolver] Done - Stuck count updated, new value: 13.
    [D] 10:55:37 - [Fight] Mob seem bugged
    [D] 10:55:38 - [Fight] Fight stopped
    10:55:38 - [Resurrect] Player dead

    This is a log of it just standing around and not fighting back. Potentially, this could be caused by me, but I don't think so.
    What could cause stucking in MovementManager when there is not even any walls around?

×
×
  • Create New...