Преглед на файлове

feat #1915: More work

tags/v0.11.0
Shaun преди 2 години
родител
ревизия
2da2d2f12c
променени са 4 файла, в които са добавени 13 реда и са изтрити 6 реда
  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 Целия файл

@@ -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);
} }
}, },




+ 9
- 4
src/server/components/gatherer.js Целия файл

@@ -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) {


+ 1
- 1
src/server/components/trade.js Целия файл

@@ -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;




+ 2
- 0
src/server/world/atlas.js Целия файл

@@ -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));


Зареждане…
Отказ
Запис