Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bad istype() in hand slot code. #4789

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

MistakeNot4892
Copy link
Contributor

No description provided.

@MistakeNot4892 MistakeNot4892 added the ready for review This PR is ready for review and merge. label Jan 22, 2025
comma
comma previously approved these changes Jan 23, 2025
@@ -1402,7 +1402,7 @@
/// THIS DOES NOT RELATE TO HELD ITEM SLOTS. It is very specifically a functional BP_L_HAND or BP_R_HAND organ, not necessarily a gripper.
/mob/proc/get_usable_hand_slot_organ()
var/obj/item/organ/external/paw = GET_EXTERNAL_ORGAN(src, BP_L_HAND)
if(!istype(paw) && !paw.is_usable())
if(istype(paw) && !paw.is_usable())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure this shouldn't be

Suggested change
if(istype(paw) && !paw.is_usable())
if(!istype(paw) || !paw.is_usable())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True.

@out-of-phaze out-of-phaze added awaiting author This PR is awaiting action from the author before it can be merged. and removed ready for review This PR is ready for review and merge. labels Jan 23, 2025
@MistakeNot4892 MistakeNot4892 added ready for review This PR is ready for review and merge. and removed awaiting author This PR is awaiting action from the author before it can be merged. labels Jan 23, 2025
if(istype(paw) && paw.is_usable())
return paw
var/static/list/hand_slots = list(BP_L_HAND, BP_R_HAND)
for(var/slot in shuffle(hand_slots))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc shuffling is actually relatively expensive, i feel a little uncomfortable about this, but it's probably fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't hot code, it's used only by a couple of specific interactions (there is also a use in get_quick_interaction_handler() but that is an error and is removed in the holsters PR).

@comma comma merged commit 4f4f496 into NebulaSS13:staging Jan 24, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is ready for review and merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants