summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game-server/gamehandler.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp
index 30a620cd..92971903 100644
--- a/src/game-server/gamehandler.cpp
+++ b/src/game-server/gamehandler.cpp
@@ -472,15 +472,20 @@ void GameHandler::handlePickup(GameClient &client, MessageIn &message)
{
Item *item = static_cast< Item * >(o);
ItemClass *ic = item->getItemClass();
- Inventory(client.character).insert(ic->getDatabaseID(),
- item->getAmount());
- GameState::remove(item);
- // log transaction
- std::stringstream str;
- str << "User picked up item " << ic->getDatabaseID()
- << " at " << opos.x << "x" << opos.y;
- accountHandler->sendTransaction(client.character->getDatabaseID(),
- TRANS_ITEM_PICKUP, str.str());
+ if (!Inventory(client.character).insert(ic->getDatabaseID(),
+ item->getAmount()))
+ {
+
+ GameState::remove(item);
+ // log transaction
+ std::stringstream str;
+ str << "User picked up item " << ic->getDatabaseID()
+ << " at " << opos.x << "x" << opos.y;
+ accountHandler->sendTransaction(
+ client.character->getDatabaseID(),
+ TRANS_ITEM_PICKUP, str.str()
+ );
+ }
break;
}
}