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

Debug messages, Engrish, and you #6034

Merged
merged 5 commits into from
Jun 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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