Made picking items up in creative mode delete them (because they usually are in the inventory already anyway)

This commit is contained in:
Perttu Ahola 2011-07-30 19:05:25 +03:00
parent cae422076b
commit 4b0c3e4357

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