From d902bd31c4b9e8c2a0d85af831a5a23f827a48a2 Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 2 Feb 2015 21:31:20 +0100 Subject: [PATCH] Fix getCraftRecipe returing wrong reciep due to way to unspecific output matching --- src/craftdef.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);