mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-06 07:18:42 +00:00
fix item exploits
Update VendorComponent.cpp Update Mail.cpp
This commit is contained in:
@@ -289,11 +289,10 @@ bool Item::Consume() {
|
||||
|
||||
GameMessages::SendUseItemResult(inventory->GetComponent()->GetParent(), lot, success);
|
||||
|
||||
if (success) {
|
||||
const auto myLot = this->lot;
|
||||
if (success && inventory->GetComponent()->RemoveItem(lot, 1, eInventoryType::ALL)) {
|
||||
// Save this because if this is the last item in the inventory
|
||||
// we may delete ourself (lol)
|
||||
const auto myLot = this->lot;
|
||||
inventory->GetComponent()->RemoveItem(lot, 1);
|
||||
auto* missionComponent = inventory->GetComponent()->GetParent()->GetComponent<MissionComponent>();
|
||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::GATHER, myLot, LWOOBJID_EMPTY, "", -1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user