From: sapier Date: Mon, 2 Feb 2015 20:31:20 +0000 (+0100) Subject: Fix getCraftRecipe returing wrong reciep due to way to unspecific output matching X-Git-Tag: 0.4.12~38 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d902bd31c4b9e8c2a0d85af831a5a23f827a48a2;p=oweals%2Fminetest.git Fix getCraftRecipe returing wrong reciep due to way to unspecific output matching --- diff --git a/src/craftdef.cpp b/src/craftdef.cpp index 9cd1d8c7e..afc41303f 100644 --- a/src/craftdef.cpp +++ b/src/craftdef.cpp @@ -954,7 +954,9 @@ public: try { tmpout = def->getOutput(input, gamedef); - if(tmpout.item.substr(0,output.item.length()) == output.item) + if((tmpout.item.substr(0,output.item.length()) == output.item) && + ((tmpout.item[output.item.length()] == 0) || + (tmpout.item[output.item.length()] == ' '))) { // Get output, then decrement input (if requested) input = def->getInput(output, gamedef);