Made picking items up in creative mode delete them (because they usually are in the...
authorPerttu Ahola <celeron55@gmail.com>
Sat, 30 Jul 2011 16:05:25 +0000 (19:05 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 30 Jul 2011 16:05:25 +0000 (19:05 +0300)
src/server.cpp

index ab60be5cc1f323ef1705afd72ca3b75ff4a3b3d1..b0c087d09a102d405aa5cb1e89f7ca5b152ec3f2 100644 (file)
@@ -2384,10 +2384,10 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                        
                        if(item)
                        {
-                               if(g_settings.getBool("creative_mode") == false)
+                               InventoryList *ilist = player->inventory.getList("main");
+                               if(ilist != NULL)
                                {
-                                       InventoryList *ilist = player->inventory.getList("main");
-                                       if(ilist != NULL)
+                                       if(g_settings.getBool("creative_mode") == false)
                                        {
                                                // Skip if inventory has no free space
                                                if(ilist->getUsedSlots() == ilist->getSize())
@@ -2400,10 +2400,10 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                                                ilist->addItem(item);
                                                UpdateCrafting(player->peer_id);
                                                SendInventory(player->peer_id);
-
-                                               // Remove object from environment
-                                               obj->m_removed = true;
                                        }
+
+                                       // Remove object from environment
+                                       obj->m_removed = true;
                                }
                        }
                        else