Blacklist fix for self crafting (#52804)

* First fix

* Ugggh
This commit is contained in:
WarlockD
2020-08-10 10:21:36 -05:00
committed by GitHub
parent 5819d24ac0
commit ff6d4ebe4a
2 changed files with 8 additions and 8 deletions
+6 -7
View File
@@ -107,18 +107,17 @@
return
for(var/atom/movable/AM in range(radius_range, a))
if(AM.flags_1 & HOLOGRAM_1)
if((AM.flags_1 & HOLOGRAM_1) || (blacklist && (AM.type in blacklist)))
continue
. += AM
/datum/component/personal_crafting/proc/get_surroundings(atom/a)
/datum/component/personal_crafting/proc/get_surroundings(atom/a, list/blacklist=null)
. = list()
.["tool_behaviour"] = list()
.["other"] = list()
.["instances"] = list()
for(var/obj/item/I in get_environment(a))
if(I.flags_1 & HOLOGRAM_1)
continue
for(var/obj/item/I in get_environment(a,blacklist))
if(.["instances"][I.type])
.["instances"][I.type] += I
else
@@ -169,14 +168,14 @@
return TRUE
/datum/component/personal_crafting/proc/construct_item(atom/a, datum/crafting_recipe/R)
var/list/contents = get_surroundings(a)
var/list/contents = get_surroundings(a,R.blacklist)
var/send_feedback = 1
if(check_contents(a, R, contents))
if(check_tools(a, R, contents))
//If we're a mob we'll try a do_after; non mobs will instead instantly construct the item
if(ismob(a) && !do_after(a, R.time, target = a))
return "."
contents = get_surroundings(a)
contents = get_surroundings(a,R.blacklist)
if(!check_contents(a, R, contents))
return ", missing component."
if(!check_tools(a, R, contents))
@@ -163,4 +163,5 @@
/datum/crafting_recipe/blackmarket_uplink/New()
..()
blacklist |= subtypesof(/obj/item/radio/)
blacklist |= typesof(/obj/item/radio/headset) // because we got shit like /obj/item/radio/off ... WHY!?!
blacklist |= typesof(/obj/item/radio/intercom)