Protolathe and qdeleted failsafe (#17984)

This commit is contained in:
Cameron Lennox
2025-07-09 22:47:26 -07:00
committed by GitHub
parent 58a50c544f
commit eeb07a837d
2 changed files with 11 additions and 3 deletions
@@ -543,10 +543,13 @@
//This is used to check if the gripper is currently being used.
//If it is, we don't allow any other actions to be performed.
/obj/item/gripper/proc/is_in_use()
if(wrapped)
if(wrapped && !QDELETED(wrapped))
if(istype(wrapped.loc, /obj/item/storage/internal/gripper))
return FALSE //We are in a gripper storage or another gripper, so we are not in use.
return TRUE
else if(QDELETED(wrapped)) //Failsafe.
wrapped = null
return FALSE //Default to 'we are not in use'
//This is the code that updates our pockets and decides if they should have icons or not.
//This should be called every time we use the gripper and our wrapped item is used up.
+7 -2
View File
@@ -112,6 +112,13 @@
if(busy)
to_chat(user, span_notice("\The [src] is busy. Please wait for completion of previous operation."))
return 1
if(isrobot(user)) //snowflake gripper BS because it can't be done in get_active_hand without breaking everything
var/mob/living/silicon/robot/robot = user
if(istype(robot.module_active, /obj/item/gripper))
var/obj/item/gripper/gripper = robot.module_active
O = gripper.get_current_pocket()
gripper.wrapped = null
gripper.current_pocket = pick(gripper.pockets)
if(default_deconstruction_screwdriver(user, O))
if(linked_console)
linked_console.linked_lathe = null
@@ -123,8 +130,6 @@
return
if(O.is_open_container())
return 1
if(istype(O, /obj/item/gripper/no_use/loader))
return 0 //Sheet loaders weren't finishing attack(), this prevents the message "You can't stuff that gripper into this" without preventing the rest of the attack sequence from finishing
if(panel_open)
to_chat(user, span_notice("You can't load \the [src] while it's opened."))
return 1