Browse Source

feat #1915: More work

tags/v0.11.0
Shaun 2 years ago
parent
commit
2da2d2f12c
4 changed files with 13 additions and 6 deletions
  1. +1
    -1
      src/server/clientComponents/inventory.js
  2. +9
    -4
      src/server/components/gatherer.js
  3. +1
    -1
      src/server/components/trade.js
  4. +2
    -0
      src/server/world/atlas.js

+ 1
- 1
src/server/clientComponents/inventory.js View File

@@ -56,7 +56,7 @@ define([

this.items.push.apply(this.items, blueprint.getItems || []);

events.emit('onGetItems', this.items, rerender);
events.emit('onGetItems', this.items, rerender, blueprint.getItems);
}
},



+ 9
- 4
src/server/components/gatherer.js View File

@@ -81,9 +81,9 @@ module.exports = {

if (this.gatheringTtl > 0) {
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);
});
}

this.gatheringTtl--;
@@ -124,7 +124,7 @@ module.exports = {
return;
}

gatherResult.items.forEach(function (g) {
gatherResult.items.forEach(g => {
if (g.slot)
return;
@@ -150,7 +150,12 @@ module.exports = {
};

g.worth = ~~(weight * 10);
}, this);
});
} else {
gatherResult.items.forEach(g => {
if (g.worth === undefined)
g.worth = 1;
});
}

if (isFish) {


+ 1
- 1
src/server/components/trade.js View File

@@ -275,7 +275,7 @@ module.exports = {
if (oldQuantity)
item.quantity = oldQuantity;

let worth = ~~(item.worth * targetTrade.markup.buy);
let worth = ~~((item.quantity ?? 1) * item.worth * targetTrade.markup.buy);

this.gold += worth;



+ 2
- 0
src/server/world/atlas.js View File

@@ -30,6 +30,8 @@ module.exports = {

if (!thread) {
if (map.instanced) {
delete obj.x;
delete obj.y;
thread = this.spawnMap(map);

await new Promise(res => setTimeout(res, 2000));


Loading…
Cancel
Save