Fixes medical grippers not being usable in surgery (#26311)

* Fixes medical grippers not being usable in surgery

* Adds a new trait for tools that behave like an open hand  in surgery. uses that instead of a typecheck.
This commit is contained in:
Migratingcocofruit
2024-08-07 03:02:03 +03:00
committed by GitHub
parent 5c32524456
commit a0308e048a
4 changed files with 15 additions and 6 deletions
+2 -2
View File
@@ -97,7 +97,7 @@
for(var/datum/surgery/S in branches_init)
first_step = S.get_surgery_step()
if(!tool && first_step.accept_hand)
if((!tool || HAS_TRAIT(tool, TRAIT_SURGICAL_OPEN_HAND)) && first_step.accept_hand)
if(SURGERY_TOOL_HAND in starting_tools)
CRASH("[src] was provided with multiple branches that allow an empty hand.")
next_surgery = S // if there's no tool, just proceed forward.
@@ -141,7 +141,7 @@
if((SURGERY_TOOL_ANY in starting_tools) && next_surgery_step.accept_any_item)
CRASH("[src] has a conflict with the next main step [next_surgery_step] in surgery [surgery]: both accept any item.")
if(!tool && next_surgery_step.accept_hand && !(SURGERY_TOOL_HAND in starting_tools))
if((!tool || HAS_TRAIT(tool, TRAIT_SURGICAL_OPEN_HAND)) && next_surgery_step.accept_hand && !(SURGERY_TOOL_HAND in starting_tools))
next_surgery = surgery
for(var/allowed in next_surgery_step.allowed_tools)
+1 -3
View File
@@ -217,9 +217,7 @@
var/success = FALSE
if(accept_hand)
if(!tool)
success = TRUE
if(isrobot(user) && istype(tool, /obj/item/gripper/medical))
if(!tool || HAS_TRAIT(tool, TRAIT_SURGICAL_OPEN_HAND))
success = TRUE
if(accept_any_item)