Skip to content

Commit

Permalink
bugfix: don't set jump time until we actually start the jump, very co…
Browse files Browse the repository at this point in the history
…nfusing otherwise
  • Loading branch information
jnnnnn committed Dec 30, 2016
1 parent 63b097e commit a8d581a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion EDAP/Pilot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public void Act()
// perform the first alignment/jump immediately
if (state.HasFlag(PilotState.firstjump) && jumps_remaining > 0)
{
StartJump();
if (AlignTarget())
Jump();
return;
Expand Down Expand Up @@ -275,12 +276,13 @@ public void Act()
}
}

private DateTime lastChargeTime = DateTime.UtcNow;
private void StartJump()
{
if (OncePerJump(PilotState.jumpCharge))
{
keyboard.Tap(keyHyperspace); // jump (frameshift drive charging)
last_jump_time = DateTime.UtcNow;
lastChargeTime = DateTime.UtcNow;
}
}

Expand All @@ -298,6 +300,7 @@ private void Jump()
{
ClearAlignKeys();
StartJump();
last_jump_time = lastChargeTime;

// If it took us a long time to align, fix the timer
if ((DateTime.UtcNow - last_jump_time).TotalSeconds > 15)
Expand Down

0 comments on commit a8d581a

Please sign in to comment.