Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ifblockPercent * sinkPercent < min
.Suppose:
blockPercent
(the percentage of the craft made from the flyblock) is6.0
sinkPercent
is set to80.0
in a craft file (so is0.8
in the code),min
for this flyblock is5.0
.Then
blockPercent * sinkPercent
will be4.8
, and the craft will always sink immediately after being piloted. The PR fixes the condition so that the craft will only sink ifblockPercent < min * sinkPercent
, which IIRC is what it previously was.Related issues:
N/A
Checklist