Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6034 from TeoTwawki/master
Browse files Browse the repository at this point in the history
Debug messages, Engrish, and you
  • Loading branch information
zynjec authored Jun 1, 2019
2 parents 95a06d8 + 3af156f commit 8088ecd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/map/packet_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ void SmallPacket0x028(map_session_data_t* session, CCharEntity* PChar, CBasicPac
if (charutils::UpdateItem(PChar, container, slotID, -quantity) != 0)
{
// TODO: Break linkshell if the main shell was disposed of.
// ShowNotice(CL_CYAN"Player %s DROPPING itemID %u \n" CL_RESET, PChar->GetName(), ItemID);
// ShowNotice(CL_CYAN"Player %s DROPPING itemID %u (quantity: %u)\n" CL_RESET, PChar->GetName(), ItemID, quantity);
PChar->pushPacket(new CMessageStandardPacket(nullptr, ItemID, quantity, MsgStd::ThrowAway));
PChar->pushPacket(new CInventoryFinishPacket());
}
Expand Down
10 changes: 6 additions & 4 deletions src/map/utils/charutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ namespace charutils

/************************************************************************
* *
* Обновляем количество предметов в указанных контейнере и ячейке *
* Update the number of items in the specified container and slot *
* *
************************************************************************/

Expand All @@ -1358,9 +1358,12 @@ namespace charutils
PChar->pushPacket(new CInventoryItemPacket(nullptr, LocationID, slotID));
return 0;
}

uint16 ItemID = PItem->getID();

if ((int32)(PItem->getQuantity() - PItem->getReserve() + quantity) < 0)
{
ShowDebug("UpdateItem: Trying to move too much quantity\n");
ShowDebug("UpdateItem: %s trying to move invalid quantity %u of itemID %u\n", PChar->GetName(), quantity, ItemID);
return 0;
}

Expand All @@ -1373,7 +1376,6 @@ namespace charutils
return 0;
}

uint32 ItemID = PItem->getID();
uint32 newQuantity = PItem->getQuantity() + quantity;

if (newQuantity > PItem->getStackSize()) newQuantity = PItem->getStackSize();
Expand Down Expand Up @@ -1435,7 +1437,7 @@ namespace charutils

/************************************************************************
* *
* Check the possibility of trade between the characters *
* Check the possibility of trade between the characters *
* *
************************************************************************/

Expand Down

0 comments on commit 8088ecd

Please sign in to comment.