Browse Source

hotfix for a vendor crash

tags/v0.4.1.2
Big Bad Waffle 4 years ago
parent
commit
aa1b18befb
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/server/components/trade.js

+ 3
- 2
src/server/components/trade.js View File

@@ -266,11 +266,12 @@ module.exports = {
let targetTrade = target.trade;

const item = this.obj.inventory.findItem(msg.itemId);
const oldQuantity = item.quantity;
this.obj.inventory.destroyItem(msg.itemId);
if (!item)
return;

const oldQuantity = item.quantity;
this.obj.inventory.destroyItem(msg.itemId);

if (oldQuantity)
item.quantity = oldQuantity;



Loading…
Cancel
Save