From 4f8153ce697858151d8916324908eaf2b5b69c03 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Sat, 3 Feb 2018 09:03:03 -0600 Subject: [PATCH] FINALLY FIXES BORG ITEM BLACKLIST AAAAAAAAAAAA --- code/citadel/dogborgstuff.dm | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/code/citadel/dogborgstuff.dm b/code/citadel/dogborgstuff.dm index d6d283a756..92c07bf4f9 100644 --- a/code/citadel/dogborgstuff.dm +++ b/code/citadel/dogborgstuff.dm @@ -331,9 +331,9 @@ var/message_cooldown var/breakout_time = 300 var/list/items_preserved = list() - var/list/important_items = list( + var/static/list/important_items = typecacheof(list( /obj/item/hand_tele, - /obj/item/card/id/captains_spare, + /obj/item/card/id, /obj/item/device/aicard, /obj/item/gun, /obj/item/pinpointer, @@ -353,7 +353,8 @@ /obj/item/bombcore, /obj/item/grenade, /obj/item/storage - ) + )) + // Bags are prohibited from this due to the potential explotation of objects, same with brought /obj/item/device/dogborg/sleeper/New() @@ -373,14 +374,10 @@ if(target.buckled) to_chat(user, "The user is buckled and can not be put into your [src.name].") return - if(istype(target,/obj/item)) - var/obj/item/target_obj = target - if(target_obj.type in important_items) - to_chat(user,"\The [target] registers an error code to your [src.name]") - return if(patient) to_chat(user, "Your [src.name] is already occupied.") return + testing("using sleeper/afterattack") user.visible_message("[hound.name] is carefully inserting [target.name] into their [src.name].", "You start placing [target] into your [src]...") if(!patient && iscarbon(target) && !target.buckled && do_after (user, 50, target = target)) @@ -654,6 +651,9 @@ if(cleaning) addtimer(CALLBACK(src, .proc/clean_cycle), 50) +/obj/item/device/dogborg/sleeper/proc/CheckAccepted(obj/item/I) + return is_type_in_typecache(I, important_items) + /obj/item/device/dogborg/sleeper/proc/inject_chem(chem) testing("inject chem triggered, checking power") if(hound.cell.charge <= 800) //This is so borgs don't kill themselves with it. Remember, 750 charge used every injection. @@ -698,6 +698,9 @@ return if(target.anchored) return + if(isobj(target)) + to_chat(user, "You are above putting such trash inside of yourself.") + return if(iscarbon(target)) var/mob/living/carbon/brigman = target if (!brigman.devourable) @@ -737,7 +740,7 @@ /obj/item/device/dogborg/sleeper/compactor/afterattack(var/atom/movable/target, mob/living/silicon/user, proximity)//GARBO NOMS hound = loc - + var/obj/item/target_obj = target if(!istype(target)) return if(!proximity) @@ -747,14 +750,16 @@ if(length(contents) > (max_item_count - 1)) to_chat(user,"Your [src.name] is full. Eject or process contents to continue.") return - if(istype(target,/obj/item)) - var/obj/item/target_obj = target - if(target_obj.type in important_items) + if(isobj(target)) + testing("Checking target type") + if(CheckAccepted(target)) to_chat(user,"\The [target] registers an error code to your [src.name]") return + testing("Target not on the important list") if(target_obj.w_class > WEIGHT_CLASS_NORMAL) to_chat(user,"\The [target] is too large to fit into your [src.name]") return + testing("Target not too large.") user.visible_message("[hound.name] is ingesting [target.name] into their [src.name].", "You start ingesting [target] into your [src.name]...") if(do_after(user, 15, target = target) && length(contents) < max_item_count) if(!in_range(src, target)) //Proximity is probably old news by now, do a new check.