OctarineSourcerer / cyberpunk2020

A FoundryVTT system for Cyberpunk 2020. It's playable now! There's a lot of hole, because there's a LOT of system to cover, but it should be mostly usable <3
22 stars 20 forks source link

Compendium attackSkill fields undefined for pistols and rifles #112

Open OctarineSourcerer opened 2 years ago

OctarineSourcerer commented 2 years ago

A great deal of weapons in compendiums have "undefined" as their weapon skill. This causes firing them to fail, with the error TypeError: Cannot read properties of undefined (reading 'data') or TypeError: skill is undefined.

See, there's a LOT of these. Like, 332 pistols and 394 rifles with this issue. So I'm going to end up writing a script to help fix that, but leave this issue up to help anyone who comes across a similar issue when using pistols or rifles from the compendiums.

To work around this, click the "Attack Skill" dropdown, and click whichever skill you'd like to use for this. The weapon should then be usable.

Addendum: The same issue also plagues availability, but I suspect that's a less problematic issue for many, as it doesn't interfere with weapons firing

OctarineSourcerer commented 2 years ago

Extra notes: each of these weapons has data.data.name set to Common. Is that their real availability? If so, easy fix, but this needs verifying and I don't have the real data on these weapons to hand.

Next steps are write a quick script to list all the ones with this issue, and perhaps an extension of this that brings up a dialogue for each, allowing to set either attack skill or availability.