Skip to content

Commit

Permalink
bugfix: blacklisted items usage in crafting (#3243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladisvell authored Aug 9, 2023
1 parent 4dcf04a commit d82c97f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions code/modules/crafting/craft.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@
var/list/parts_used = list()
var/list/reagent_containers_for_deletion = list()
var/list/item_stacks_for_deletion = list()
for(var/atom/movable/thing in surroundings)
if(thing.type in recipe.blacklist)
surroundings -= thing

for(var/thing in recipe.reqs)
var/needed_amount = recipe.reqs[thing]
Expand Down
2 changes: 1 addition & 1 deletion code/modules/crafting/recipes.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/crafting_recipe
var/name = "" //in-game display name
var/reqs[] = list() //type paths of items consumed associated with how many are needed
var/blacklist[] = list() //type paths of items explicitly not allowed as an ingredient
var/blacklist[] = list() //type paths of items explicitly not allowed as an ingredient, you can expand it in New() by using typecacheof to ban subtypes
var/result //type path of item resulting from this craft
var/tools[] = list() //tool behaviours of items needed but not consumed
var/pathtools[] = list() //type paths of items needed but not consumed
Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/guns/throw/crossbow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
reqs = list(/datum/reagent/fuel = 10,
/obj/item/stack/sheet/cloth = 1,
/obj/item/arrow/rod = 1)
blacklist = list(/obj/item/arrow/rod/fire)
time = 5
category = CAT_WEAPONRY
subcategory = CAT_AMMO
Expand Down

0 comments on commit d82c97f

Please sign in to comment.