ose icon indicating copy to clipboard operation
ose copied to clipboard

Weapon Qualities are doubled and incorrect.

Open lonpalmer opened this issue 2 years ago • 3 comments

What happened?

The weapons qualities icons in the inventory pane are doubled for the first two qualities and don't show any qualities after that.

See Screen Shot. Screenshot 2023-04-22 at 8 45 04 AM Screenshot 2023-04-22 at 8 41 12 AM

What is the expected behaviour?

The weapon quality icons should correctly match the weapon qualities.

Relevant Errors and Warnings

No response

Additional Support Details

Foundry V 10.291 OSE v 1.8.2 OSE SRD 0.5.3 OSE Helper 0.4.6

Foundry VTT Core Version

V10

Old-School Essentials Core Version

1.8.2

Please update your browser regularly. Which (updated) browsers are you seeing the problem on?

Chrome

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

lonpalmer avatar Apr 22 '23 13:04 lonpalmer

The melee, missile, and slow qualities are assigned through the toggle buttons and checkbox on the item sheet. They're doubled up because items have extra qualities assigned to them from before we changed item.system.autoTags to generate tags for those checkboxes without having the tags in the tag list.

So... functionality's correct, data isn't. 😅

wyrmisis avatar Apr 22 '23 16:04 wyrmisis

So should this defect be on a different project?

lonpalmer avatar Apr 22 '23 19:04 lonpalmer

We will indeed treat this as a bug.

After making this change in tag behavior, we neglected to add migrations that removed the unnecessary tags from all worlds and compendiums. We will do that here, in response to this ticket.

If you'd like to fix this now rather than wait for the migration patch, here's a useful script macro. It will have to be modified to work with your items in the world, and your items in all actors in your world

async function main(){

    const pack = await game.packs.get("");//Place your pack's name between the quotes
    for(let i of pack){
            let item = await pack.getDocument(i._id);
            if(item.type === 'weapon' && item.system.tags.length){
                let arr= [];
                for(let tag of item.system.tags){
                    if(tag.value !== 'Melee' && tag.value !== 'Missile' && tag.value !== 'Slow'){
                        arr.push(tag);
                        console.log(item.name + ": " + tag.value);
                    }
                }
                await item.update({
                    "system.tags": arr
                });
            }
        }
        
    }
main()

anthonyronda avatar Apr 24 '23 17:04 anthonyronda