Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Attempting to put items in a full vault results in them being mailed to you #462

Closed
3 tasks done
EmosewaMC opened this issue Feb 22, 2022 · 0 comments · Fixed by #1595
Closed
3 tasks done

BUG: Attempting to put items in a full vault results in them being mailed to you #462

EmosewaMC opened this issue Feb 22, 2022 · 0 comments · Fixed by #1595
Labels
bug Something isn't working P-medium This issue does affect gameplay, but not critically enough that they are unable to play.

Comments

@EmosewaMC
Copy link
Collaborator

Make sure you've done the following:

  • I have checked that this issue has not already been reported.

  • I have validated that this issue is not a syntax error of either MySQL or SQLite.

  • I have pulled the latest version of the main branch of DarkflameServer and have confirmed that the issue exists there.

Issue Description

When a vault is full, attempting to put an item into it will result in the item being mailed to you. I have not tested this with items that can be stacked yet but items that don't stack will be mailed upon trying to place in the full vault.
The GameMessage that handles this is

void GameMessages::HandleMoveItemBetweenInventoryTypes(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
int inventoryTypeA;
int inventoryTypeB;
LWOOBJID objectID;
bool showFlyingLoot = true;
bool stackCountIsDefault = false;
uint32_t stackCount = 1;
bool templateIDIsDefault = false;
LOT templateID = LOT_NULL;
inStream->Read(inventoryTypeA);
inStream->Read(inventoryTypeB);
inStream->Read(objectID);
inStream->Read(showFlyingLoot);
inStream->Read(stackCountIsDefault);
if (stackCountIsDefault) inStream->Read(stackCount);
inStream->Read(templateIDIsDefault);
if (templateIDIsDefault) inStream->Read(templateID);
InventoryComponent* inv = static_cast<InventoryComponent*>(entity->GetComponent(COMPONENT_TYPE_INVENTORY));
if (!inv) return;
auto* item = inv->FindItemById(objectID);
if (item == nullptr)
{
item = inv->FindItemByLot(templateID);
if (item == nullptr)
{
return;
}
}
if (entity->GetCharacter()) {
if (entity->GetCharacter()->GetBuildMode()) {
showFlyingLoot = false;
}
}
inv->MoveItemToInventory(item, static_cast<eInventoryType>(inventoryTypeB), stackCount, showFlyingLoot, false);
EntityManager::Instance()->SerializeEntity(entity);
}

Reproduction steps

  1. Fill a vault
  2. Place item in said full vault
  3. Check player mail

Expected Behavior

Item stays in previous inventory or something happens so that the item isnt mailed to you.

Environment

WSL

@EmosewaMC EmosewaMC added bug Something isn't working triage An issue that needs triage labels Feb 22, 2022
@NealSpellman NealSpellman added P-medium This issue does affect gameplay, but not critically enough that they are unable to play. and removed triage An issue that needs triage labels Mar 24, 2022
@EmosewaMC EmosewaMC self-assigned this Apr 23, 2022
@EmosewaMC EmosewaMC removed their assignment Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-medium This issue does affect gameplay, but not critically enough that they are unable to play.
Projects
None yet
2 participants