Skip to content

Instantly share code, notes, and snippets.

@sapier
Created February 2, 2015 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sapier/d715be2ba96c50d79a7a to your computer and use it in GitHub Desktop.
Save sapier/d715be2ba96c50d79a7a to your computer and use it in GitHub Desktop.
diff --git a/src/craftdef.cpp b/src/craftdef.cpp
index 9cd1d8c..fa1f9ea 100644
--- a/src/craftdef.cpp
+++ b/src/craftdef.cpp
@@ -954,7 +954,9 @@ class CCraftDefManager: public IWritableCraftDefManager
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);
@@ -991,7 +993,9 @@ class CCraftDefManager: public IWritableCraftDefManager
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment