Closed morikal closed 1 month ago
Confirmed on cdda-experimental-2024-07-19-1400 b1cf8e3 [64-bit] from earlier in the day too; segfault occurs when equipping any worn item onto a naked character through the armor sort screen.
No-location / cosmetic items crash the game too.
Integrated armor saves it from crashing, but pop-up "Can't put this on under your integrated armor!" seems to suggest it's attempting to place them "below" the integrated armor item and is being successfully caught.
Tried to fix this by checking if tmp_worn was empty and emplace the new item at both the back and the front of "worn" if it was, rather than to try to get the first element of an empty vector (and crash) . In both cases it doesn't crash, but I end up with two copies of the item worn, and it appears I get duplication when those are take off.
Edit: Realized duplication was because the splicing was moving, not inserting, and that insertion had already been done above. Thus, the whole "rearrange to align cursor" stuff could simply be skipped if the list was empty.
Describe the bug
When naked, go to the + menu (armor/layer sorting) and navigate to the torso. Press 'E' to equip armor to this location, equip thermal electric outfit -> segfault.
Note that if I don't drop all my worn things first, there is no crash. Further, even if I do drop all my things first, if I equip via the 'W'ear action there is no crash.
crash.log
Attach save file
South Holland-trimmed.tar.gz
Steps to reproduce
Expected behavior
No crash
Screenshots
No response
Versions and configuration
Additional context
No response