Skip to content

Commit

Permalink
fix: do not activate A/FRWK when not trying to climb
Browse files Browse the repository at this point in the history
Signed-off-by: Octol1ttle <[email protected]>
  • Loading branch information
Octol1ttle committed Feb 5, 2024
1 parent c9c32fe commit ce6af20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void tick() {
if (data.speed < targetSpeed) {
firework.activateFirework(false);
}
} else if (targetAltitude != null && targetAltitude > data.altitude && data.velocity.y < 0.0f) {
} else if (targetAltitude != null && targetAltitude > data.altitude && data.pitch > 0 && data.velocity.y < 0.0f) {
firework.activateFirework(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void renderFireworkMode(DrawContext context, TextRenderer textRenderer)
String type = autoflight.selectedSpeed != null ? ".selected" : ".managed";
fireworkMode.update(Text.translatable("flightassistant.mode.firework.speed" + type, targetSpeed));
} else if (autoflight.getTargetAltitude() != null) {
if (autoflight.getTargetAltitude() > data.altitude + 2.0f && data.velocityPerSecond.y < -2.0f) {
if (autoflight.getTargetAltitude() > data.altitude + 2.0f && data.pitch > 0 && data.velocity.y < 0.0f) {
fireworkMode.update(Text.translatable("flightassistant.mode.firework.climb"));
} else {
fireworkMode.update(Text.translatable("flightassistant.mode.firework.idle"));
Expand Down

0 comments on commit ce6af20

Please sign in to comment.