-
Notifications
You must be signed in to change notification settings - Fork 224
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
Conversation
code/modules/mob/mob.dm
Outdated
@@ -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()) |
There was a problem hiding this comment.
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
if(istype(paw) && !paw.is_usable()) | |
if(!istype(paw) || !paw.is_usable()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True.
056c2e7
to
a27d4e4
Compare
a27d4e4
to
e821ee0
Compare
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)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
No description provided.