V8 Engine fixes (#71033)

The V8 engine now allows you to learn the recipe and will no longer runtime when it checks if you already know it.
This commit is contained in:
lizardqueenlexi
2022-11-06 06:09:01 -05:00
committed by GitHub
parent 6f359afd90
commit 443879531d
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -504,7 +504,7 @@
/datum/mind/proc/has_crafting_recipe(mob/user, potential_recipe)
if(!learned_recipes)
return FALSE
if(!istype(potential_recipe, /datum/crafting_recipe))
if(!ispath(potential_recipe, /datum/crafting_recipe))
CRASH("Non-crafting recipe passed to has_crafting_recipe")
for(var/recipe in user.mind.learned_recipes)
if(recipe == potential_recipe)
+2 -3
View File
@@ -33,14 +33,13 @@
INVOKE_ASYNC(src, .proc/start_learning_recipe, user)
/obj/item/v8_engine/proc/start_learning_recipe(mob/user)
var/datum/crafting_recipe/house_edge/edge
if(!user.mind)
return
if(user.mind.has_crafting_recipe(user = user, potential_recipe = edge))
if(user.mind.has_crafting_recipe(user = user, potential_recipe = /datum/crafting_recipe/house_edge))
return
to_chat(user, span_notice("You peer at the label on the side, reading about some unique modifications that could be made to the engine..."))
if(do_after(user, 15 SECONDS, src))
user.mind.teach_crafting_recipe(edge)
user.mind.teach_crafting_recipe(/datum/crafting_recipe/house_edge)
to_chat(user, span_notice("You learned how to make the House Edge."))