Skip to content

Commit

Permalink
Commentary added to Event.Interval case
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny 'Riketta' Chugaev committed Jul 3, 2018
1 parent 750d580 commit 7ae4277
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Warcraft Fishman/Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,19 @@ public void Invoke(IntPtr hWnd)

case Event.Interval:
// if action already should be called or if it should be called while next fishing action - call it now
if (DateTime.Now.AddMilliseconds(Fish.CastTime) > LastInvoke.AddSeconds(Interval))
if (DateTime.Now.AddMilliseconds(Fish.CastTime) > LastInvoke.AddSeconds(Interval)) // won't work if Intercal == Cooldown
{
logger.Info("Calling event");
PressKey(hWnd);
Sleep();
LastInvoke = DateTime.Now;
}
break;

case Event.None:
default:
throw new Exception("Invalid trigger type to invoke current action");
}

LastInvoke = DateTime.Now;
}

private void Sleep()
Expand Down

0 comments on commit 7ae4277

Please sign in to comment.