diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index be2a97a4201..2a2306cce3c 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -585,7 +585,7 @@ icon_state = "RPED" item_state = "RPED" w_class = 5 - can_hold = list(/obj/item/weapon/stock_parts) + can_hold = list("/obj/item/weapon/stock_parts") storage_slots = 14 use_to_pickup = 1 allow_quick_gather = 1 diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 60b21d60de0..09b9d3fe3e4 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -340,11 +340,11 @@ /obj/machinery/mecha_part_fabricator/proc/build_part(var/obj/item/part) if(!part) return - + // critical exploit prevention, do not remove unless you replace it -walter0o if( !(locate(part, src.contents)) || !(part.vars.Find("construction_time")) || !(part.vars.Find("construction_cost")) ) // these 3 are the current requirements for an object being buildable by the mech_fabricator return - + src.being_built = new part.type(src) src.desc = "It's building [src.being_built]." src.remove_resources(part) @@ -576,24 +576,24 @@ /obj/machinery/mecha_part_fabricator/proc/exploit_prevention(var/obj/Part, mob/user as mob, var/desc_exploit) // critical exploit prevention, feel free to improve or replace this, but do not remove it -walter0o - + if(!Part || !user || !istype(Part) || !istype(user)) // sanity return 1 - + if( !(locate(Part, src.contents)) || !(Part.vars.Find("construction_time")) || !(Part.vars.Find("construction_cost")) ) // these 3 are the current requirements for an object being buildable by the mech_fabricator - + var/turf/LOC = get_turf(user) message_admins("[key_name_admin(user)] tried to exploit an Exosuit Fabricator to [desc_exploit ? "get the desc of" : "duplicate"] [Part] ! ([LOC ? "JMP" : "null"])", 0) - log_admin("EXPLOIT : [key_name(user)] tried to exploit an Exosuit Fabricator to [desc_exploit ? "get the desc of" : "duplicate"] [Part] !") + log_admin("EXPLOIT : [key_name(user)] tried to exploit an Exosuit Fabricator to [desc_exploit ? "get the desc of" : "duplicate"] [Part] !") return 1 - + return null /obj/machinery/mecha_part_fabricator/Topic(href, href_list) if(..()) // critical exploit prevention, do not remove unless you replace it -walter0o return - + var/datum/topic_input/filter = new /datum/topic_input(href,href_list) if(href_list["part_set"]) var/tpart_set = filter.getStr("part_set") @@ -605,24 +605,24 @@ screen = "parts" if(href_list["part"]) var/obj/part = filter.getObj("part") - + // critical exploit prevention, do not remove unless you replace it -walter0o if(src.exploit_prevention(part, usr)) return - + if(!processing_queue) build_part(part) else add_to_queue(part) if(href_list["add_to_queue"]) var/obj/part = filter.getObj("add_to_queue") - + // critical exploit prevention, do not remove unless you replace it -walter0o if(src.exploit_prevention(part, usr)) return - + add_to_queue(part) - + return update_queue_on_page() if(href_list["remove_from_queue"]) remove_from_queue(filter.getNum("remove_from_queue")) @@ -661,12 +661,12 @@ return update_queue_on_page() if(href_list["part_desc"]) var/obj/part = filter.getObj("part_desc") - + // critical exploit prevention, do not remove unless you replace it -walter0o if(src.exploit_prevention(part, usr, 1)) return - - if(part) + + if(part) temp = {"

[part] description:

[part.desc]
Return @@ -711,6 +711,8 @@ /obj/machinery/mecha_part_fabricator/attackby(obj/W as obj, mob/user as mob) + if(exchange_parts(user, W)) + return if(istype(W,/obj/item/weapon/screwdriver)) if (!opened) opened = 1 diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 6fa91b4aaf3..92a6ee3a97d 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -50,6 +50,8 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). return g_amount + gold_amount + diamond_amount + uranium_amount attackby(var/obj/item/O as obj, var/mob/user as mob) + if(exchange_parts(user, O)) + return if (shocked) shock(user,50) if (istype(O, /obj/item/weapon/screwdriver)) diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 72430976b84..1d643871293 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -99,6 +99,9 @@ Note: Must be placed within 3 tiles of the R&D Console spawn(10) icon_state = "d_analyzer_l" busy = 0 + + if(exchange_parts(user, O)) + return return //For testing purposes only. diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index db057ffdde0..9b330492fc7 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -53,6 +53,8 @@ Note: Must be placed west/left of and R&D console to function. max_material_storage = T * 75000 /obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob) + if(exchange_parts(user, O)) + return if (shocked) shock(user,50) if (O.is_open_container()) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 65c66588653..7c712391fe4 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -121,6 +121,8 @@ env.merge(removed) /obj/machinery/r_n_d/server/attackby(var/obj/item/O as obj, var/mob/user as mob) + if(exchange_parts(user, O)) + return if (disabled) return if (shocked)