From f3551fcc2c5478dc3866c8263882ebf9663dac33 Mon Sep 17 00:00:00 2001 From: xcxooxl Date: Wed, 6 Apr 2016 12:01:58 +0300 Subject: [PATCH] Fix for orbwalker It was killing barrels when not needed --- .../BadaoGangplank/BadaoGangplankAuto.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/BadaoGangplank/BadaoChampion/BadaoGangplank/BadaoGangplankAuto.cs b/BadaoGangplank/BadaoChampion/BadaoGangplank/BadaoGangplankAuto.cs index af0ef0a..dfaf076 100644 --- a/BadaoGangplank/BadaoChampion/BadaoGangplank/BadaoGangplankAuto.cs +++ b/BadaoGangplank/BadaoChampion/BadaoGangplank/BadaoGangplankAuto.cs @@ -16,6 +16,28 @@ public static class BadaoGangplankAuto public static void BadaoActivate() { Game.OnUpdate += Game_OnUpdate; + Orbwalking.BeforeAttack += Orbwalking_BeforeAttack; + } + + static void Orbwalking_BeforeAttack(Orbwalking.BeforeAttackEventArgs args) + { + if (!args.Unit.IsMe) + return; + foreach (var barrel in BadaoGangplankBarrels.AttackableBarrels()) + { + if (barrel.Bottle.NetworkId.Equals(args.Target.NetworkId)) + { + switch (Orbwalking.Orbwalker.Instances.First().ActiveMode) + { + case Orbwalking.OrbwalkingMode.LaneClear: + case Orbwalking.OrbwalkingMode.LastHit: + case Orbwalking.OrbwalkingMode.Mixed: + args.Process = false; + break; + } + } + + } } private static void Game_OnUpdate(EventArgs args)