diff options
author | TeTpaAka <TeTpaAka@users.noreply.github.com> | 2015-06-02 20:30:04 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-06-22 19:30:35 +0200 |
commit | 17ba584fe254eeaee3489cc20e03810a59f3ef9b (patch) | |
tree | 33ff4e30753c243a607ccb06b93d27c325eb1103 /src/craftdef.h | |
parent | 0b76e85a717a05b608d09618bb48434510f0ae27 (diff) | |
download | minetest-17ba584fe254eeaee3489cc20e03810a59f3ef9b.tar.gz minetest-17ba584fe254eeaee3489cc20e03810a59f3ef9b.tar.bz2 minetest-17ba584fe254eeaee3489cc20e03810a59f3ef9b.zip |
Fix bug when craft input isn't replaced
Diffstat (limited to 'src/craftdef.h')
-rw-r--r-- | src/craftdef.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/craftdef.h b/src/craftdef.h index f62ad3313..cebb2d7ae 100644 --- a/src/craftdef.h +++ b/src/craftdef.h @@ -150,7 +150,8 @@ public: // the inverse of the above virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const=0; // Decreases count of every input item - virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const=0; + virtual void decrementInput(CraftInput &input, + std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const=0; virtual CraftHashType getHashType() const = 0; virtual u64 getHash(CraftHashType type) const = 0; @@ -187,7 +188,8 @@ public: virtual bool check(const CraftInput &input, IGameDef *gamedef) const; virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const; virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const; - virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const; + virtual void decrementInput(CraftInput &input, + std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const; virtual CraftHashType getHashType() const; virtual u64 getHash(CraftHashType type) const; @@ -235,7 +237,8 @@ public: virtual bool check(const CraftInput &input, IGameDef *gamedef) const; virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const; virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const; - virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const; + virtual void decrementInput(CraftInput &input, + std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const; virtual CraftHashType getHashType() const; virtual u64 getHash(CraftHashType type) const; @@ -278,7 +281,8 @@ public: virtual bool check(const CraftInput &input, IGameDef *gamedef) const; virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const; virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const; - virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const; + virtual void decrementInput(CraftInput &input, + std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const; virtual CraftHashType getHashType() const { return CRAFT_HASH_TYPE_COUNT; } virtual u64 getHash(CraftHashType type) const { return 2; } @@ -320,7 +324,8 @@ public: virtual bool check(const CraftInput &input, IGameDef *gamedef) const; virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const; virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const; - virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const; + virtual void decrementInput(CraftInput &input, + std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const; virtual CraftHashType getHashType() const; virtual u64 getHash(CraftHashType type) const; @@ -365,7 +370,8 @@ public: virtual bool check(const CraftInput &input, IGameDef *gamedef) const; virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const; virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const; - virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const; + virtual void decrementInput(CraftInput &input, + std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const; virtual CraftHashType getHashType() const; virtual u64 getHash(CraftHashType type) const; @@ -398,6 +404,7 @@ public: // The main crafting function virtual bool getCraftResult(CraftInput &input, CraftOutput &output, + std::vector<ItemStack> &output_replacements, bool decrementInput, IGameDef *gamedef) const=0; virtual std::vector<CraftDefinition*> getCraftRecipes(CraftOutput &output, IGameDef *gamedef, unsigned limit=0) const=0; @@ -414,6 +421,7 @@ public: // The main crafting function virtual bool getCraftResult(CraftInput &input, CraftOutput &output, + std::vector<ItemStack> &output_replacements, bool decrementInput, IGameDef *gamedef) const=0; virtual std::vector<CraftDefinition*> getCraftRecipes(CraftOutput &output, IGameDef *gamedef, unsigned limit=0) const=0; |