forked from OpenWF/SpaceNinjaServer
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: OpenWF/SpaceNinjaServer#2714
Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com>
Co-authored-by: AlexisinGit <alexisingit@noreply.localhost>
Co-committed-by: AlexisinGit <alexisingit@noreply.localhost>
This commit is contained in:
parent
5a2fa2c2c3
commit
a2171c80a5
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user