Open sol-oriens opened 6 years ago
Never what?
That was just a reminder for later after having another look at it, but since you ask... https://github.com/sol-oriens/Shores-of-Infinity/commit/b8d4a1e012b21e5c7578cf11c030f5241a015ab7#diff-bcc74daa79ddaa145ad66642c8f5eff4
I explained the issue in the comments.
I independently ran into this in my own mod and wrote a slightly different fix which might be of interest https://github.com/Skeletonxf/star-ruler-2-mod-ce/blob/master/colonisation-expansion/scripts/server/objects/Ship.as#L1203
No, that's wrong. bp.removedHP
counts hexes which have been removed from the blueprint, such as Crystalline Armor. Telling the blueprint that it's fully repaired (at full HP) when it isn't is also less than ideal, since it may introduce a different kind of inaccuracy. Simply canceling the repairs (damage = 0
) would suffice.
Whoops I'll fix that. Regardless I did empirically find that the damage not being repaired was orders of magnitude less than 1, so I think checking damage against a fractional threshold rather than casting it to an integer may be a better solution.
This needs to be reviewed with Dalo and dolynick to maybe find a more proper way to fix it.