Add files via upload

pre-0.4.4
Felix 2019-12-29 19:10:27 +01:00 committed by GitHub
parent 9b5613e43c
commit f0a5c5932b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -117,7 +117,7 @@ class SpellBrowser extends Application {
// getting damage types // getting damage types
spell.damageTypes = []; spell.damageTypes = [];
if (spell.data.damage.parts.length > 0) { if (spell.data.damage && spell.data.damage.parts.length > 0) {
for (let part of spell.data.damage.parts) { for (let part of spell.data.damage.parts) {
let type = part[1]; let type = part[1];
if (spell.damageTypes.indexOf(type) === -1) { if (spell.damageTypes.indexOf(type) === -1) {
@ -180,7 +180,7 @@ class SpellBrowser extends Application {
if (item.type == 'spell') { if (item.type == 'spell') {
npc.hasSpells = true; npc.hasSpells = true;
} }
if (item.data.damage.parts.length > 0) { if (item.data.damage && item.data.damage.parts.length > 0) {
for (let part of item.data.damage.parts) { for (let part of item.data.damage.parts) {
let type = part[1]; let type = part[1];
if (npc.damageDealt.indexOf(type) === -1) { if (npc.damageDealt.indexOf(type) === -1) {
@ -564,9 +564,11 @@ class SpellBrowser extends Application {
} }
} else { } else {
if (typeof prop === 'object') { if (typeof prop === 'object') {
if (filter.value && prop.indexOf(filter.value) === -1) { if (filter.value) {
return false; if (prop.indexOf(filter.value) === -1) {
} else { return false;
}
} else if(filter.values) {
for (let val of filter.values) { for (let val of filter.values) {
if (prop.indexOf(val) !== -1) { if (prop.indexOf(val) !== -1) {
continue; continue;

View File

@ -2,7 +2,7 @@
"name": "compendium-browser", "name": "compendium-browser",
"title": "Compendium Browser", "title": "Compendium Browser",
"description": "A module to easily browse and filter spells as well as npcs loaded from compendie.", "description": "A module to easily browse and filter spells as well as npcs loaded from compendie.",
"version": "0.1", "version": "0.1.1",
"author": "Felix#6196", "author": "Felix#6196",
"systems": ["dnd5e"], "systems": ["dnd5e"],
"scripts": ["./compendium-browser.js"], "scripts": ["./compendium-browser.js"],