Handle items with m_count==0 sanely when placing
authorPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 19:05:53 +0000 (21:05 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 19:05:53 +0000 (21:05 +0200)
src/server.cpp

index 70638a0a6f79cede78c9fca003ff34184b5c6daa..4cabcda0ca35e1a6893a48dc2b7823a71358c7e3 100644 (file)
@@ -3361,7 +3361,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                                        if(g_settings->getBool("creative_mode") == false && ilist)
                                        {
                                                // Remove from inventory and send inventory
-                                               if(mitem->getCount() == 1)
+                                               if(mitem->getCount() <= 1)
                                                        ilist->deleteItem(item_i);
                                                else
                                                        mitem->remove(1);