From 835276e07ed00561fb336f5d50b8bfeccd846d4c Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 16 May 2015 03:18:43 -0400 Subject: [PATCH] Fixes cooking machinery runtimes Some recipes were sorted using paths that resulted in empty recipe types (for example, /datum/recipe/microwave/human/burger causing an empty /detum/recipe/microwave/human type to exist). These would be included in the available recipes, and since their requirements are null, would all be satisfied by anything in the machine. Since their result is null, a runtime would occur while trying to create nothing. This fixes some (all? Too lazy to test them all) kitchen machines never failing. --- code/game/machinery/kitchen/microwave.dm | 6 +++++- code/modules/food/candy_maker.dm | 6 +++++- code/modules/food/grill_new.dm | 6 +++++- code/modules/food/oven_new.dm | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 17b260747dd..1fba31f1da9 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -33,7 +33,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/microwave)-/datum/recipe/microwave)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/microwave/recipe in available_recipes) diff --git a/code/modules/food/candy_maker.dm b/code/modules/food/candy_maker.dm index 269c2fcc33b..7e12fc327bf 100644 --- a/code/modules/food/candy_maker.dm +++ b/code/modules/food/candy_maker.dm @@ -33,7 +33,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/candy)-/datum/recipe/candy)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/candy/recipe in available_recipes) diff --git a/code/modules/food/grill_new.dm b/code/modules/food/grill_new.dm index 6fcd5e3a31a..ee8bd4bf460 100644 --- a/code/modules/food/grill_new.dm +++ b/code/modules/food/grill_new.dm @@ -34,7 +34,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/grill)-/datum/recipe/grill)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/grill/recipe in available_recipes) diff --git a/code/modules/food/oven_new.dm b/code/modules/food/oven_new.dm index 1b0c3559cf0..7d6022ae9ae 100644 --- a/code/modules/food/oven_new.dm +++ b/code/modules/food/oven_new.dm @@ -34,7 +34,11 @@ if (!available_recipes) available_recipes = new for (var/type in (typesof(/datum/recipe/oven)-/datum/recipe/oven)) - available_recipes+= new type + var/datum/recipe/recipe = new type + if(recipe.result) // Ignore recipe subtypes that lack a result + available_recipes += recipe + else + del(recipe) acceptable_items = new acceptable_reagents = new for (var/datum/recipe/oven/recipe in available_recipes)