Skip to content

Commit

Permalink
Merge pull request #13126 from Kurohyou/Fix/SWADE-FC-Drops
Browse files Browse the repository at this point in the history
SWADE Official: Fix FC drop errors
  • Loading branch information
BronsonHall authored Jul 25, 2024
2 parents 1095c5d + ea3bfe7 commit 6219474
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Official Savage Worlds/SavageWorldsCharSheet.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

<script type="text/worker">
const sheetVersionPrefix = 'Official Savage Worlds v';
//# sourceURL=SWADE.js
const sheetVersionPrefix = 'Official Savage Worlds v';
const sheetVersion = '1.00.30';

// Define colors for Logs
Expand Down Expand Up @@ -2245,6 +2246,7 @@
return m;
}, searchArray);
debug({searchArray});
debugger;
lookupBurndown(statblock, productArray, searchArray, callback, origBlock,IDPathways);
});
};
Expand Down Expand Up @@ -2341,6 +2343,7 @@
return false;
}
});

if (!compendiumObj) { //If we didn't find an object matching the expansion pathways and the object name, just find the first item with a matching name
compendiumObj = dataArr.find((dataObj) => (dataObj.data[nameAttrLookup[phegObj.type]] || dataObj.name) === objName);
if (!compendiumObj) { //If there still isn't a matching compendium object, return the original PHEG
Expand Down Expand Up @@ -2672,14 +2675,14 @@
? (targetObj[`${section}_damageatt`] = 'na')
: log('damageatt', 'Found...will set appropriately', r20color);
targetObj[`${section}_weaponcarried`] = 'on';
if (jsonObj['dmgdietype'] === 'dmgdietype') {
if (jsonObj.hasOwnProperty('dmgdietype')) {
//check if the format is correct
typeof jsonObj['dmgdietype'] !== 'undefined' &&
parseInt(jsonObj['dmgdietype'] || 0) > 0
? (jsonObj['dmgdietype'] = 'd' + jsonObj['dmgdietype'] + '!')
? (jsonObj['dmgdietype'] = `d${jsonObj['dmgdietype']}!`)
: log(
'dmgdietype',
"Either isn't defined or is formatted correctly, hopefully",
"Either isn't defined or is not formatted correctly, hopefully",
r20color
);
}
Expand Down Expand Up @@ -2765,7 +2768,7 @@
};

const dropWeapons = function({repSectionID,repSection,targetObj,jsonObj,attributes}){
jsonObj['weaponnotes'] = jsonObj['description'];
jsonObj['weaponnotes'] = jsonObj['description'] ?? '';
targetObj[`repeating_${repSection}_${repSectionID}_showweaponconfig`] = 0;
determineWeaponOptions(
jsonObj,
Expand Down Expand Up @@ -3287,6 +3290,7 @@
'Write PHEG data and all remaining attributes to character sheet',
r20color
);
debugger;
setAttrs(finalCharacterDetails);
});
},
Expand Down

0 comments on commit 6219474

Please sign in to comment.