Fix getCraftRecipe returing wrong reciep due to way to unspecific output matching
authorsapier <Sapier at GMX dot net>
Mon, 2 Feb 2015 20:31:20 +0000 (21:31 +0100)
committersapier <Sapier at GMX dot net>
Mon, 2 Feb 2015 20:32:23 +0000 (21:32 +0100)
src/craftdef.cpp

index 9cd1d8c7ef12f2823c1e6622ce1bf787638c260d..afc41303fd564436f1d46d4f0597a76f32fae4f6 100644 (file)
@@ -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);