Barotrauma
Barotrauma copied to clipboard
buying weapons to scaled hardpoints has bad placement
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?
Scaled weapon purchase seems to be offset incorrectly.
90 degrees rotated, 0.3 scale hardpoint
railgun aftter purchase:
default scaled hardpoint resulted in non-buggy behaviour, although the it's a bit too big to fit, hence trying to scale the hardpoint down
Reproduction steps
- 90 degrees rotated, 0.3 scale hardpoint
- purchase a weapon. I chose railgun because it's big.
- go to new level to apply changes
Bug prevalence
Happens every time I play
Version
0.18.12.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/e9f7ccf8895075fdffa5e2e33b4d9203ad488a65
Tested on 0.19.0.0, not sure if this is working as intended or if there are substantial differences between weapon types:
Before switching weapons (using one micro, one standard size and one supersized weapon):
After swapping all three:
Reverted the commit for now https://github.com/Regalis11/Barotrauma-development/commit/968c3ac777a9148c294703382d32b64fae8bfad8, need to rethink the calculations in a way that works when the new item has different dimensions than the old one.
Reverted the commit for now Regalis11/Barotrauma-development@968c3ac, need to rethink the calculations in a way that works when the new item has different dimensions than the old one.
Perhaps use hardpoint position origin as the frame of reference instead of the sprite sourcerect & origins?
Perhaps use hardpoint position origin as the frame of reference instead of the sprite sourcerect & origins?
We don't use the sprite sourcerect or origin to calculate it, but the position of the hardpoint origin. The issue is in the way the position of the origin is calculated on scaled and rotated items.