Adds GetTypeInAllContents, which should be self-explanatory. Recursively checks for a typepath locating in an atom.

It's used by cavity implants to make sure you can't slip the nuke disk in.
This commit is contained in:
Pete Goodfellow
2013-03-28 13:00:32 +00:00
parent 818b0a94ef
commit bb82a0f2c3
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
/datum/surgery_step/handle_cavity/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(tool)
if(IC || tool.w_class > 3 || istype(tool, /obj/item/weapon/disk/nuclear) || istype(tool, /obj/item/organ))
if(IC || tool.w_class > 3 || tool.GetTypeInAllContents(/obj/item/weapon/disk/nuclear) || istype(tool, /obj/item/organ))
user.visible_message("<span class='notice'>[user] can't seem to fit [tool] in [target]'s [target_zone].</span>")
return 0
else