mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-06 03:10:22 +00:00
Disallow attaching the same item to an email twice
Also fix vendor buying validation not allowing crates to be bought, since apparently their maximum stack size is 0 in TableData.
This commit is contained in:
@@ -135,7 +135,13 @@ void NPCManager::npcVendorBuy(CNSocket* sock, CNPacketData* data) {
|
||||
|
||||
int itemCost = itemDat->buyPrice * (itemDat->stackSize > 1 ? req->Item.iOpt : 1);
|
||||
int slot = ItemManager::findFreeSlot(plr);
|
||||
if (itemCost > plr->money || slot == -1 || req->Item.iOpt > itemDat->stackSize) {
|
||||
if (itemCost > plr->money || slot == -1) {
|
||||
sock->sendPacket((void*)&failResp, P_FE2CL_REP_PC_VENDOR_ITEM_BUY_FAIL, sizeof(sP_FE2CL_REP_PC_VENDOR_ITEM_BUY_FAIL));
|
||||
return;
|
||||
}
|
||||
|
||||
// crates don't have a stack size in TableData, so we can't check those
|
||||
if (itemDat->stackSize != 0 && req->Item.iOpt > itemDat->stackSize) {
|
||||
sock->sendPacket((void*)&failResp, P_FE2CL_REP_PC_VENDOR_ITEM_BUY_FAIL, sizeof(sP_FE2CL_REP_PC_VENDOR_ITEM_BUY_FAIL));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user