More accurate checking in layering conflicts #54897
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Bugfixes "More accurate checking in armor layering conflicts"
Purpose of change
fixes #54871
Describe the solution
The really low level layer conflict code was using a simple convenience function, originally used for if items should display a UI element, to test if it should do sublimb testing on the items in question or just assume they conflict. This was dumb and wrong of me.
Some test needs to be there since some limbs don't have sublocations.
So I removed the incorrect it.has_sublocations() test and instead just test if the bodypart has sublimbs a much simpler solution which is also correct.
Describe alternatives you've considered
Testing
Try the heavy load bearing vest and a duffel bag.
Heavy Ballistic Vest with an attached pouch and a shoulder strapped rifle is the test with just about the most edge case opportunity and it works.
Additional context
I need to spend some time at some point writing a bunch of test items and tests for this.