aboutsummaryrefslogtreecommitdiff
path: root/src/serverobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/serverobject.cpp')
-rw-r--r--src/serverobject.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/serverobject.cpp b/src/serverobject.cpp
index 9cf817859..699040bf2 100644
--- a/src/serverobject.cpp
+++ b/src/serverobject.cpp
@@ -90,14 +90,9 @@ ItemStack ServerActiveObject::getWieldedItem() const
bool ServerActiveObject::setWieldedItem(const ItemStack &item)
{
- Inventory *inv = getInventory();
- if(inv)
- {
- InventoryList *list = inv->getList(getWieldList());
- if (list)
- {
+ if(Inventory *inv = getInventory()) {
+ if (InventoryList *list = inv->getList(getWieldList())) {
list->changeItem(getWieldIndex(), item);
- setInventoryModified();
return true;
}
}