Browse Source

bug #1921

tags/v0.11.0
Shaun 2 years ago
parent
commit
f38e0587be
3 changed files with 8 additions and 6 deletions
  1. +1
    -1
      src/server/components/equipment.js
  2. +4
    -2
      src/server/components/inventory.js
  3. +3
    -3
      src/server/components/inventory/getItem.js

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

@@ -126,7 +126,7 @@ module.exports = {

if ((!obj.mob) || (item.ability)) {
if (item.spell)
inventory.learnAbility({ itemId, slot: item.runeSlot });
inventory.learnAbility({ itemId, slot: item.runeSlot, bypassEqCheck: true });
else
obj.syncer.setArray(true, 'inventory', 'getItems', inventory.simplifyItem(item));
}


+ 4
- 2
src/server/components/inventory.js View File

@@ -145,10 +145,12 @@ module.exports = {
}
},

learnAbility: function ({ itemId, slot }) {
//forceEq is set by the equipment component to force the ability to be learnt since the item is already EQd
// otherwise the first if check would fail
learnAbility: function ({ itemId, slot, bypassEqCheck = false }) {
let item = this.findItem(itemId);
let statValues = this.obj.stats.values;
if (!item || item.eq)
if (!item || (item.eq && !bypassEqCheck))
return;
else if (!item.spell) {
item.eq = false;


+ 3
- 3
src/server/components/inventory/getItem.js View File

@@ -123,12 +123,12 @@ module.exports = (cpnInv, item, hideMessage, noStack, hideAlert, createBagIfFull
cpnInv.items.push(item);

if (item.eq) {
delete item.eq;

if (item.ability)
cpnInv.learnAbility({ itemId: item.id, slot: item.runeSlot });
else {
delete item.eq;
else
obj.equipment.equip({ itemId: item.id });
}
} else if (item.has('quickSlot')) {
obj.equipment.setQuickSlot({
itemId: item.id,


Loading…
Cancel
Save