fix deep-fried anything recipe collision (#29114)

This commit is contained in:
warriorstar-orion
2025-04-26 18:10:45 +00:00
committed by GitHub
parent 1c5dc033e1
commit fc9958dac8
3 changed files with 18 additions and 3 deletions
@@ -70,12 +70,16 @@
if(!istype(food_item))
return PCWJ_CHECK_INVALID
if("deep fried" in food_item.cooktype)
tracker.step_reaction_message = "That is already deep-fried!"
return PCWJ_CHECK_INVALID
// check to see if this is something that belongs to another deep fryer
// recipe with only one item
for(var/datum/cooking/recipe/recipe in GLOB.pcwj_recipe_dictionary[/obj/item/reagent_containers/cooking/deep_basket])
if(length(recipe.steps) == 2) // One add step and one deep fry step
var/datum/cooking/recipe_step/add_item/add_item_step = recipe.steps[1]
if(istype(add_item_step) && add_item_step.check_conditions_met(added_item, tracker) == PCWJ_CHECK_VALID)
if(istype(add_item_step) && (src != add_item_step) && add_item_step.check_conditions_met(added_item, tracker) == PCWJ_CHECK_VALID)
return PCWJ_CHECK_INVALID
return PCWJ_CHECK_VALID
@@ -83,7 +87,7 @@
/datum/cooking/recipe/deep_fried_anything
container_type = /obj/item/reagent_containers/cooking/deep_basket
steps = list(
PCWJ_ADD_ITEM(/obj/item/food),
new /datum/cooking/recipe_step/add_item/deep_fried_anything(),
PCWJ_USE_DEEP_FRYER(10 SECONDS),
)
appear_in_default_catalog = FALSE
@@ -100,6 +104,7 @@
result.color = "#FFAD33"
result.name = "deep-fried [food_item.name]"
result.desc = "It has been deep-fried."
result.cooktype["deep fried"] = TRUE
food_item.reagents.trans_to(result, food_item.reagents.total_volume)
qdel(food_item)