From 8370437358bb75e80738166f7f9c8597fb700eae Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 6 Jul 2020 18:21:58 -0300 Subject: Blank blueprints handling --- npc/items/recipes.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/npc/items/recipes.txt b/npc/items/recipes.txt index e85bf2ba..485336e3 100644 --- a/npc/items/recipes.txt +++ b/npc/items/recipes.txt @@ -169,7 +169,13 @@ function script MakeBlueprint { } - // We now (maybe) have a .@recipes array set + // We don't have a .@recipes array D: + if (array_entries(.@recipes) <= 0) { + dispbottom l("This blueprint was blank."); + return; + } + + // Select a recipe randomly .@rcp=any_of(.@recipes); // Double precision failsafe -- cgit v1.2.3-70-g09d2