Fix missing check for 0 in craft replacements
authorTeTpaAka <TeTpaAka@users.noreply.github.com>
Sat, 4 Jul 2015 09:28:09 +0000 (11:28 +0200)
committerest31 <MTest31@outlook.com>
Sat, 4 Jul 2015 12:33:49 +0000 (14:33 +0200)
src/craftdef.cpp

index cc0e83be7c70b9d61e2d77d18b4fb3c6f2aa89e0..bad0d393b2bf76ff38e84c53184aa32985b664cd 100644 (file)
@@ -235,8 +235,8 @@ static void craftDecrementOrReplaceInput(CraftInput &input,
                                }
                        }
                }
-               // No replacement was found, simply decrement count to zero
-               if (!found_replacement)
+               // No replacement was found, simply decrement count by one
+               if (!found_replacement && it->count > 0)
                        it->remove(1);
        }
 }