Skip to content

Commit

Permalink
Fixes crafting recipe stack type validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 11, 2025
1 parent a588779 commit b38f355
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions code/modules/crafting/stack_recipes/_recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,16 @@
else if(length(used_skill.levels) < difficulty)
. += "required skill [recipe_skill] is missing skill level [json_encode(difficulty)]"

if(length(forbidden_craft_stack_types) && length(craft_stack_types))
for(var/stack_type in (forbidden_craft_stack_types|craft_stack_types))
if((stack_type in craft_stack_types) && (stack_type in forbidden_craft_stack_types))
var/list/check_forbidden_craft_stack_types = forbidden_craft_stack_types
if(check_forbidden_craft_stack_types && !islist(check_forbidden_craft_stack_types))
check_forbidden_craft_stack_types = list(check_forbidden_craft_stack_types)
var/list/check_craft_stack_types = craft_stack_types
if(check_craft_stack_types && !islist(check_craft_stack_types))
check_craft_stack_types = list(check_craft_stack_types)

if(length(check_forbidden_craft_stack_types) && length(check_craft_stack_types))
for(var/stack_type in (check_forbidden_craft_stack_types|check_craft_stack_types))
if((stack_type in check_craft_stack_types) && (stack_type in check_forbidden_craft_stack_types))
. += "[stack_type] is in both forbidden and craftable stack types"

/decl/stack_recipe/proc/get_required_stack_amount(obj/item/stack/stack)
Expand Down

0 comments on commit b38f355

Please sign in to comment.