@@ -56,7 +56,7 @@ define([ | |||||
this.items.push.apply(this.items, blueprint.getItems || []); | this.items.push.apply(this.items, blueprint.getItems || []); | ||||
events.emit('onGetItems', this.items, rerender); | |||||
events.emit('onGetItems', this.items, rerender, blueprint.getItems); | |||||
} | } | ||||
}, | }, | ||||
@@ -81,9 +81,9 @@ module.exports = { | |||||
if (this.gatheringTtl > 0) { | if (this.gatheringTtl > 0) { | ||||
if (this.gatheringTtl === this.gatheringTtlMax && gathering.width > 1) { | if (this.gatheringTtl === this.gatheringTtlMax && gathering.width > 1) { | ||||
['x', 'y', 'width', 'height'].forEach(function (p) { | |||||
['x', 'y', 'width', 'height'].forEach(p => { | |||||
this.obj.syncer.set(false, 'gatherer', p, gathering[p]); | this.obj.syncer.set(false, 'gatherer', p, gathering[p]); | ||||
}, this); | |||||
}); | |||||
} | } | ||||
this.gatheringTtl--; | this.gatheringTtl--; | ||||
@@ -124,7 +124,7 @@ module.exports = { | |||||
return; | return; | ||||
} | } | ||||
gatherResult.items.forEach(function (g) { | |||||
gatherResult.items.forEach(g => { | |||||
if (g.slot) | if (g.slot) | ||||
return; | return; | ||||
@@ -150,7 +150,12 @@ module.exports = { | |||||
}; | }; | ||||
g.worth = ~~(weight * 10); | g.worth = ~~(weight * 10); | ||||
}, this); | |||||
}); | |||||
} else { | |||||
gatherResult.items.forEach(g => { | |||||
if (g.worth === undefined) | |||||
g.worth = 1; | |||||
}); | |||||
} | } | ||||
if (isFish) { | if (isFish) { | ||||
@@ -275,7 +275,7 @@ module.exports = { | |||||
if (oldQuantity) | if (oldQuantity) | ||||
item.quantity = oldQuantity; | item.quantity = oldQuantity; | ||||
let worth = ~~(item.worth * targetTrade.markup.buy); | |||||
let worth = ~~((item.quantity ?? 1) * item.worth * targetTrade.markup.buy); | |||||
this.gold += worth; | this.gold += worth; | ||||
@@ -30,6 +30,8 @@ module.exports = { | |||||
if (!thread) { | if (!thread) { | ||||
if (map.instanced) { | if (map.instanced) { | ||||
delete obj.x; | |||||
delete obj.y; | |||||
thread = this.spawnMap(map); | thread = this.spawnMap(map); | ||||
await new Promise(res => setTimeout(res, 2000)); | await new Promise(res => setTimeout(res, 2000)); | ||||