Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Azazel666 opened this issue Aug 29, 2023 · 1 comment
Closed

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

Azazel666 opened this issue Aug 29, 2023 · 1 comment

Comments

@Azazel666
Copy link

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
Copy link
Owner

pafvel commented Sep 2, 2023

Fixed by d2c06d5

@pafvel pafvel closed this as completed Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants