// Token: 0x060009F9 RID: 2553 RVA: 0x0002B730 File Offset: 0x00029930
 private void OnUpdate()
 {
     try
     {
         if (!this.Sleeper.IsSleeping)
         {
             Unit9 unit = base.TargetManager.TargetLocked ? base.TargetManager.Target : this.killSteal.Target;
             if (unit != null && unit.IsValid && unit.IsVisible)
             {
                 foreach (KeyValuePair <ActiveAbility, float> keyValuePair in this.abilityTimings.ToList <KeyValuePair <ActiveAbility, float> >())
                 {
                     ActiveAbility ability = keyValuePair.Key;
                     if (ability.IsValid && ability.BaseAbility.IsInAbilityPhase)
                     {
                         Unit9            owner           = ability.Owner;
                         float            value           = keyValuePair.Value;
                         PredictionInput9 predictionInput = ability.GetPredictionInput(unit, null);
                         predictionInput.Delay = Math.Max(value - Game.RawGameTime, 0f) + ability.ActivationDelay;
                         PredictionOutput9 predictionOutput = ability.GetPredictionOutput(predictionInput);
                         Vector3           vector;
                         if (ability is IHasRadius && this.abilityPositions.TryGetValue(ability.Handle, out vector))
                         {
                             Polygon       polygon  = null;
                             ActiveAbility ability2 = ability;
                             if (ability2 != null)
                             {
                                 AreaOfEffectAbility areaOfEffectAbility;
                                 if ((areaOfEffectAbility = (ability2 as AreaOfEffectAbility)) == null)
                                 {
                                     CircleAbility circleAbility;
                                     if ((circleAbility = (ability2 as CircleAbility)) == null)
                                     {
                                         ConeAbility coneAbility;
                                         if ((coneAbility = (ability2 as ConeAbility)) == null)
                                         {
                                             LineAbility lineAbility;
                                             if ((lineAbility = (ability2 as LineAbility)) != null)
                                             {
                                                 LineAbility lineAbility2 = lineAbility;
                                                 polygon = new Polygon.Rectangle(owner.Position, Vector3Extensions.Extend2D(owner.Position, vector, lineAbility2.Range), lineAbility2.Radius + 50f);
                                             }
                                         }
                                         else
                                         {
                                             ConeAbility coneAbility2 = coneAbility;
                                             polygon = new Polygon.Trapezoid(Vector3Extensions.Extend2D(owner.Position, vector, -coneAbility2.Radius / 2f), Vector3Extensions.Extend2D(owner.Position, vector, coneAbility2.Range), coneAbility2.Radius + 50f, coneAbility2.EndRadius + 100f);
                                         }
                                     }
                                     else
                                     {
                                         CircleAbility circleAbility2 = circleAbility;
                                         polygon = new Polygon.Circle(vector, circleAbility2.Radius + 50f, 20);
                                     }
                                 }
                                 else
                                 {
                                     AreaOfEffectAbility areaOfEffectAbility2 = areaOfEffectAbility;
                                     polygon = new Polygon.Circle(vector, areaOfEffectAbility2.Radius + 50f, 20);
                                 }
                             }
                             if (polygon != null && (!unit.IsAlive || predictionOutput.HitChance == null || !polygon.IsInside(predictionOutput.TargetPosition)))
                             {
                                 this.Sleeper.Sleep(0.15f);
                                 this.abilityTimings.Remove(ability);
                                 this.abilityPositions.Remove(ability.Handle);
                                 this.OrbwalkSleeper.Reset(ability.Owner.Handle);
                                 this.AbilitySleeper.Reset(ability.Handle);
                                 this.killSteal.KillStealSleeper.Reset();
                                 unit.RefreshUnitState();
                                 ability.Owner.BaseUnit.Stop();
                                 ControllableUnit controllableUnit = base.BaseHero.UnitManager.AllControllableUnits.FirstOrDefault((ControllableUnit x) => x.Handle == ability.Owner.Handle);
                                 if (controllableUnit != null)
                                 {
                                     controllableUnit.ComboSleeper.Reset();
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex, null);
     }
 }