A small robustness addition to ItemStack
authorPerttu Ahola <celeron55@gmail.com>
Tue, 6 Dec 2011 13:32:41 +0000 (15:32 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 1 Jan 2012 23:49:38 +0000 (01:49 +0200)
src/scriptapi.cpp

index f1035516ad5e11451f77d0b41bd4a6e95d2e9d77..8a4e0b0d90fe64a33f0e115a2352e574df6012d7 100644 (file)
@@ -1496,7 +1496,7 @@ private:
        {
                ItemStack *o = checkobject(L, 1);
                push_stack_item(L, o->m_stack);
-               if(o->m_stack->getCount() == 1){
+               if(o->m_stack->getCount() <= 1){
                        delete o->m_stack;
                        o->m_stack = NULL;
                } else {