Browse Source

fixes #704

tags/v0.4.1.4
Big Bad Waffle 4 years ago
parent
commit
67861a2b28
2 changed files with 8 additions and 5 deletions
  1. +4
    -0
      src/server/components/equipment.js
  2. +4
    -5
      src/server/components/gatherer.js

+ 4
- 0
src/server/components/equipment.js View File

@@ -28,6 +28,10 @@ module.exports = {
};
},

isSlotEmpty: function (slot) {
return !this.eq.has(slot);
},

autoEquip: function (itemId) {
if (!this.doAutoEq)
return;


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

@@ -23,6 +23,8 @@ module.exports = {
if (nodes.length === 0)
return;

const { obj: { equipment, stats } } = this;

let firstNode = nodes[0];

this.gathering = firstNode;
@@ -30,17 +32,14 @@ module.exports = {
let ttlMax = firstNode.resourceNode.ttl || this.defaultTtlMax;

if (firstNode.resourceNode.nodeType === 'fish') {
let rod = this.obj.equipment.eq.tool;
if (!rod) {
if (equipment.isSlotEmpty('tool')) {
this.sendAnnouncement('You need a fishing rod to fish');
this.gathering = null;

return;
}

rod = this.obj.inventory.findItem(rod);

let statCatchSpeed = Math.min(150, this.obj.stats.values.catchSpeed);
let statCatchSpeed = Math.min(150, stats.values.catchSpeed);
ttlMax *= (1 - (statCatchSpeed / 200));
}



Loading…
Cancel
Save