XFEstudio/XFESpaceNinjaServer
fix: CrewShipFusion bug with SubroutineIndex (#2714)
Crewship fusion didn't agree with player's choice. Expected results:  What I actually get:  ``` export interface ICrewShipComponentFingerprint extends IInnateDamageFingerprint { SubroutineIndex?: number; } ``` The interface already demand SubroutineIndex to exist, so it would be unnecessary to check. Meanwhile, inferiorFingerprint.SubroutineIndex could be 0, 1, 2... and might be handled incorrectly as true/ false. Co-authored-by: AlexisinGit <136088944+AlexisinGit@users.noreply.github.com> Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2714 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AlexisinGit <alexisingit@noreply.localhost> Co-committed-by: AlexisinGit <alexisingit@noreply.localhost>
a2171c80
代码差异
@@ -81,7 +81,7 @@ export const crewShipFusionController: RequestHandler = async (req, res) => {
const newFval = (newPerc - rangeA[0]) / (rangeA[1] - rangeA[0]);
buffA.Value = Math.trunc(newFval * 0x3fffffff);
}
if (inferiorFingerprint.SubroutineIndex) {
if (inferiorFingerprint.SubroutineIndex !== undefined) {
const useSuperiorSubroutine = tierA < tierB ? !payload.UseSubroutineA : payload.UseSubroutineA;
if (!useSuperiorSubroutine) {
fingerprint.SubroutineIndex = inferiorFingerprint.SubroutineIndex;