fix: CrewShipFusion bug with SubroutineIndex #2714

Merged
Sainan merged 3 commits from AlexisinGit/SpaceNinjaServerAlexFork:main into main 2025-08-28 05:50:29 -07:00
Contributor

Crewship fusion didn't agree with player's choice.

Expected results: image.png

What I actually get: image.png

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.

Crewship fusion didn't agree with player's choice. Expected results: ![image.png](/attachments/a61c96c7-1624-4dd4-9e4c-c6199d5af95a) What I actually get: ![image.png](/attachments/cf58aed4-18d9-4d97-8894-6c53762f366d) ``` 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.
378 KiB
206 KiB
AlexisinGit added 1 commit 2025-08-27 16:42:53 -07:00
fix: CrewShipFusion bug with SubroutineIndex
All checks were successful
Build / build (pull_request) Successful in 1m46s
62607f15ec
Owner

I see there's a bug here, but I do think you should simply change the condition to inferiorFingerprint.SubroutineIndex !== undefined to avoid 0 being treated as false. I'm not sure outright removing it is a great idea.

I see there's a bug here, but I do think you should simply change the condition to `inferiorFingerprint.SubroutineIndex !== undefined` to avoid 0 being treated as false. I'm not sure outright removing it is a great idea.
AlexisinGit added 2 commits 2025-08-27 21:03:24 -07:00
This reverts commit 62607f15ec76c6eda7e3a79c6a58c0c39547ec35.
fix: CrewShipFusion bug specify typecheck
All checks were successful
Build / build (pull_request) Successful in 1m23s
8c8c651d63
Author
Contributor

It is done. A little type check won't do no harm.

It is done. A little type check won't do no harm.
Sainan approved these changes 2025-08-27 21:10:34 -07:00
Sainan merged commit a2171c80a5 into main 2025-08-28 05:50:29 -07:00
Sign in to join this conversation.
No description provided.