Skip to content

get_body_parts_coverage Fix

Rob Nelson requested to merge pull/6752/MyBranch into Bleeding-Edge

Created by: Sircrab

Fix for the issue #6747 (closed), The old method was simply checking if a piece of clothing had ANY of the flags in the argument: E.g: If HANDS is 000010000 and FULL_BODY = 000010111 The old method was checking if(HANDS & FULL_BODY) and returned the piece of clothing, this is incorrect since, for example, gloves don't cover full body.

The current fix now makes this method return the piece of clothing ONLY if the piece of clothing contains all of the flags specified in the argument.

E.g: HANDS is 000010000 and FULL_BODY = 000010111 HANDS&FULL_BODY = 000010000 which is NOT full_body so gloves fail the test.

This doesn't break any other functionality since things that relied that a piece of clothing covered other parts would still work.

E.g: An exosuit has flags: 010010111, if i wanted to check if it covered for instance Upper body (000000100), then the current method would return: 010010111 & 000000100 = 0000000100 which IS Upper body then it the method would return exosuit as a valid piece of clothing.

This method also works for composed flags (Upper_body|Lower_body,etc).

Merge request reports