Skip to content

Commit

Permalink
fix transgressions size + v
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace committed Jul 26, 2020
1 parent b63c049 commit 4df18c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Curse/MainCurse.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async function CursedCheckUp() {
}
}
}

// Saves if needed, strip not required data
if (messagesToVerify.length > 0) {
SaveConfigs();
Expand Down
10 changes: 9 additions & 1 deletion Curse/Utilities/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
function SaveConfigs() {
try {
const dbConfigs = { ...cursedConfig };
const toDelete = ["chatStreak", "chatlog", "mustRefresh", "isRunning", "onRestart", "wasLARPWarned", "ownerIsHere", "mistressIsHere", "genericProcs", "toUpdate", "say", "warned", "shouldPopSilent"];
const toDelete = ["chatStreak", "chatlog", "mustRefresh", "isRunning", "onRestart", "wasLARPWarned", "ownerIsHere", "mistressIsHere", "genericProcs", "toUpdate", "say", "warned", "shouldPopSilent", "transgressionsWarning"];
toDelete.forEach(prop => delete dbConfigs[prop]);

// Cleans up transgressions
if (cursedConfig.transgressions.length > 100) {
cursedConfig.transgressions.splice(0, cursedConfig.transgressions.length - 100);
cursedConfig.transgressionsWarning && popChatSilent("ERROR T100: you have accumulated too many transgressions. Please have your curse owner clear your transgressions list to make room for new ones (cleartrangressions command). Your oldest transgressions on your record will now be deleted one by one", "System");
cursedConfig.transgressionsWarning = true;
}

localStorage.setItem(`bc-cursedConfig-${Player.MemberNumber}`, JSON.stringify(dbConfigs));
} catch (err) {
alert("Your curse configs were not saved. Check the console for errors and report the issue if necessary.");
Expand Down
4 changes: 2 additions & 2 deletions Utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//************************************Callbacks************************************

//Boot up sequence
window.currentManifestVersion = "1.2.5.1";
window.currentVersion = 43;
window.currentManifestVersion = "1.2.5.2";
window.currentVersion = 44;
let AlwaysOn;
let isLoaded;

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "BC - Cursed",
"description": "Injects the scripts needed to wear the curse",
"version": "1.2.5.1",
"version": "1.2.5.2",
"background": {
"scripts": [
"Extension/Ext_Backgound.js"
Expand Down

0 comments on commit 4df18c7

Please sign in to comment.