pafvel / dragonbane

Other
11 stars 6 forks source link

Bug: Small/Tiny items don't work for weapons. #11

Closed Azazel666 closed 10 months ago

Azazel666 commented 10 months ago

I have noticed that tiny/small items don't work for weapons. I had a look in the code and it seems like it only works for "items". eg. item below:

if (item.type == "item") {
    if (item.system.weight == 0 && item.system.type != "backpack" && this.actor.type == "character")
    {
        smallItems.push(item);
        continue;
    }
    inventory.push(item);
    continue;
}

weapon below:

if (item.type == "weapon") {
    if (item.system.worn) {
        // TODO limit 3
        equippedWeapons.push(item);
    } else {
        inventory.push(item);
    }
    // weapons can be mementos
    if (item.system.memento && this.actor.type == "character") {
        if (!memento) {
            memento = item;
        } else {
            // Memento slot busy. Clear flag and process as normal item
            item.update({ ["system.memento"]: false });
        }
    }

    continue;
}

As seen weapons is never on any condition added to the smallitems collection.

pafvel commented 10 months ago

Fixed by https://github.com/pafvel/dragonbane/commit/d2c06d53fd228c6ddfe2d27126b074b03379ade4