diff --git a/Shadow of the Demon Lord/README.md b/Shadow of the Demon Lord/README.md index 44a29e13d2..60e63a49b3 100644 --- a/Shadow of the Demon Lord/README.md +++ b/Shadow of the Demon Lord/README.md @@ -2,6 +2,9 @@ ## Change log +### Version 7 +* Fixed a bug preventing creation of new NPC attacks + ### Version 6 * Styling cleanup, using CSS grid instead of Flexbox in some key places * Added a rest button diff --git a/Shadow of the Demon Lord/Source/sheetworkers.js b/Shadow of the Demon Lord/Source/sheetworkers.js index c642bc9611..4ffbc256ce 100644 --- a/Shadow of the Demon Lord/Source/sheetworkers.js +++ b/Shadow of the Demon Lord/Source/sheetworkers.js @@ -459,18 +459,23 @@ const updateSheet = version => { calcWeaponDamage(idArray.map(id => `repeating_weapons_${id}_weapon`)); }); } + if (version < 7) { + getSectionIDs("repeating_attacks", idArray => { + idArray.forEach(id => updateNpcAttack(`repeating_attacks_${id}`)); + }); + } }; // Register events on("sheet:opened", () => { getAttrs(["version"], v => { const version = parseInt(v.version); - if (version && version < 6) { - updateSheet(5); + if (version && version < 7) { + updateSheet(version); } setAttrs({ - version: "6", - character_sheet: "Shadow of the Demon Lord v6", + version: "7", + character_sheet: "Shadow of the Demon Lord v7", }); }); setBoonsBanesQuery(); @@ -501,7 +506,7 @@ register(["setting_roll_weapon_damage", "global_damage_bonus", "setting_show_dam }); }); register(["repeating_weapons"], () => calcWeaponDamage(["repeating_weapons_weapon"])); -register(["change:repeating_attacks:attack_range"], () => updateNpcAttack("repeating_attacks_attack")); +register(["repeating_attacks:attack_range"], () => updateNpcAttack("repeating_attacks_attack")); ["weapon", "attack"].forEach(sName => { register([`repeating_${sName}s:${sName}_boons`], () => { calcBoonsDisplay(`repeating_${sName}s_${sName}`); @@ -540,4 +545,4 @@ register(["npc", "sheet:opened"], sanitizeTab); }); // Basic equipment: turn off auto-defense -register(["change:setting_basic_equipment"], handleBasicEquipment); +register(["setting_basic_equipment"], handleBasicEquipment); diff --git a/Shadow of the Demon Lord/shadow-of-the-demon-lord.html b/Shadow of the Demon Lord/shadow-of-the-demon-lord.html index 83288b5d0c..e3f205d966 100644 --- a/Shadow of the Demon Lord/shadow-of-the-demon-lord.html +++ b/Shadow of the Demon Lord/shadow-of-the-demon-lord.html @@ -1,3 +1,3 @@