Switching to a lower-tier submarine makes you lose upgrades
Disclaimers
- [X] I have searched the issue tracker to check if the issue has already been reported.
- [ ] My issue happened while using mods.
What happened?
When you switch to a lower-tier sub, the upgrades get clamped to the maximum of that sub. But when you switch back to the higher-tier one, they remain clamped, meaning you lose the upgrades.
Reproduction steps
- Select a tier 2 or 3 sub
- Max upgrades
- Switch to a lower tier sub
- Switch back to the original sub, notice the upgrades are no longer maxed
Bug prevalence
Happens every time I play
Version
0.19.11.0
-
No response
Which operating system did you encounter this bug on?
Windows
Relevant error messages and crash reports
No response
Fixed in https://github.com/Regalis11/Barotrauma-development/commit/1acf6d91e72ba126b67e0d61e4e15b193cac456c
Tested by maxing a Typhon2's upgrades, switching to a Dugong with clamped but maxed upgrades, and then switching back to Typhon2. Maximum upgrades were retained, issue is fixed.
Reopening: the fix causes the upgrades to get clamped to the default maximum for that specific upgrade, ignoring the tier/class bonuses.
Steps to repro:
- Start a campaign with Typhon 2
- Max turret upgrades (4 levels thanks to the Attack class bonus)
- Start a new round
- Notice the upgrades get reduced to level 3
Tested above repro steps, working correctly. Closing.