Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to RequiredBlockEntry #472

Merged
merged 2 commits into from
Dec 16, 2021
Merged

Conversation

galacticwarrior9
Copy link
Contributor

@galacticwarrior9 galacticwarrior9 commented Dec 7, 2021

Describe in detail what your pull request accomplishes

This PR fixes two issues related to the RequiredBlockEntry class.

Firstly, it fixes integer division being used when calculating blockPercent. This led to imprecision that could prevent crafts which just about satisfied the flyblock requirements from being piloted.

Secondly, it fixes the sinkPercent craft flag. Currently, a craft will sink if blockPercent * sinkPercent < min.
Suppose:

  • blockPercent (the percentage of the craft made from the flyblock) is 6.0
  • sinkPercent is set to 80.0 in a craft file (so is 0.8 in the code),
  • min for this flyblock is 5.0.

Then blockPercent * sinkPercent will be 4.8, and the craft will always sink immediately after being piloted. The PR fixes the condition so that the craft will only sink if blockPercent < min * sinkPercent, which IIRC is what it previously was.

Related issues:

N/A

Checklist

  • Tested

@TylerS1066 TylerS1066 merged commit bd6fab2 into APDevTeam:main Dec 16, 2021
This was referenced Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants