diff --git a/customizer.js b/customizer.js index db2ea0e..2125fe9 100644 --- a/customizer.js +++ b/customizer.js @@ -251,12 +251,13 @@ function encodeCustom(custom, verbose) { let val_max = custom.get("maxRolls").has(id) ? custom.get("maxRolls").get(id) : 0; let sign = (Boolean(val_min / Math.abs(val_min) < 0) | 0) + 2*(Boolean(val_max / Math.abs(val_max) < 0) | 0) // 0 - both pos 1 - min neg max pos 2 - min pos max neg (how?) 3 - min neg max neg //console.log(id + ": " + sign); - let min_len = Math.max(1,Math.ceil(log(64,Math.abs(val_min)))); - let max_len = Math.max(1,Math.ceil(log(64,Math.abs(val_max)))); + let min_len = Math.max(1,Math.ceil(log(64,Math.abs(val_min)+1))); + let max_len = Math.max(1,Math.ceil(log(64,Math.abs(val_max)+1))); let len = Math.max(min_len,max_len); val_min = Math.abs(val_min); val_max = Math.abs(val_max); + if ( val_min != 0 || val_max != 0 ) { //hash += Base64.fromIntN(i,2) + Base64.fromIntN(val_min,Math.max(1,Math.ceil(log(64,Math.abs(val_min))))) + ":" + Base64.fromIntN(val_max,Math.max(1,Math.ceil(log(64,Math.abs(val_min))))) + "_"; if (custom.get("fixID")) { @@ -321,6 +322,7 @@ function decodeCustom(custom_url_tag) { while (tag !== "") { let id = ci_save_order[Base64.toInt(tag.slice(0,2))]; let len = Base64.toInt(tag.slice(2,4)); + console.log(id); if (rolledIDs.includes(id)) { let sign = parseInt(tag.slice(4,5),10); let minRoll = Base64.toInt(tag.slice(5,5+len)); diff --git a/media/memes/agony.png b/media/memes/agony.png index aa91fd0..d95d043 100644 Binary files a/media/memes/agony.png and b/media/memes/agony.png differ