X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fcraftdef.cpp;h=9cd1d8c7ef12f2823c1e6622ce1bf787638c260d;hb=a230e1e7360eb561429bf69ad8793745fbd5e7c3;hp=c79408f9986b177aa0933f7aa777e6ef38aea78f;hpb=5af8acfa6e41e258dd7e2135e8e75f03096c1d5c;p=minetest.git diff --git a/src/craftdef.cpp b/src/craftdef.cpp index c79408f99..9cd1d8c7e 100644 --- a/src/craftdef.cpp +++ b/src/craftdef.cpp @@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "inventory.h" #include "util/serialize.h" #include "strfnd.h" +#include "exceptions.h" // Check if input matches recipe // Takes recipe groups into account @@ -150,23 +151,6 @@ static bool craftGetBounds(const std::vector &items, unsigned int w return success; } -#if 0 -// This became useless when group support was added to shapeless recipes -// Convert a list of item names to a multiset -static std::multiset craftMakeMultiset(const std::vector &names) -{ - std::multiset set; - for(std::vector::const_iterator - i = names.begin(); - i != names.end(); i++) - { - if(*i != "") - set.insert(*i); - } - return set; -} -#endif - // Removes 1 from each item stack static void craftDecrementInput(CraftInput &input, IGameDef *gamedef) { @@ -541,7 +525,7 @@ bool CraftDefinitionShapeless::check(const CraftInput &input, IGameDef *gamedef) } // Try with all permutations of the recipe - std::vector recipe_copy = recipe; + std::vector recipe_copy = craftGetItemNames(recipe, gamedef); // Start from the lexicographically first permutation (=sorted) std::sort(recipe_copy.begin(), recipe_copy.end()); //while(std::prev_permutation(recipe_copy.begin(), recipe_copy.end())){}