From ef6309d9be8d750b3138052e278410f7306b58a1 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 14 Sep 2020 23:17:42 -0300 Subject: Validate batch crafting - We made the code unstable anyway --- npc/craft/alchemy.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'npc/craft') diff --git a/npc/craft/alchemy.txt b/npc/craft/alchemy.txt index 6e0084596..9022edb84 100644 --- a/npc/craft/alchemy.txt +++ b/npc/craft/alchemy.txt @@ -43,9 +43,15 @@ function script AlchemySystem { // Alchemy loop .@i=0; while (.@i < .@m) { + .@s=validatecraft(.@craft); + // Could not validate (not enough resources) + if (!.@s) { + mesc l("Not crafting - insufficient materials!"), 1; + break; + } .@s=usecraft(.@craft); .@i++; - // Failed for whatever reason + // Exploiting?! if (!.@s) break; } -- cgit v1.2.3-70-g09d2