HOTFIX: Handle case when atree decode fails (extremely ungracefully)

Also fix a bunch of bugs with warrior and archer trees
This commit is contained in:
hppeng 2022-12-16 02:48:00 -08:00
parent 2561feb621
commit ca43faacf1
5 changed files with 17 additions and 13 deletions

File diff suppressed because one or more lines are too long

View file

@ -1182,7 +1182,7 @@ const atrees = {
"desc": "Enemies near you will be slowed down.", "desc": "Enemies near you will be slowed down.",
"parents": [ "parents": [
"Geyser Stomp", "Geyser Stomp",
"More Focus II" "Cheaper Arrow Bomb II"
], ],
"dependencies": [], "dependencies": [],
"blockers": [], "blockers": [],
@ -2333,7 +2333,7 @@ const atrees = {
"archetype_req": 0, "archetype_req": 0,
"base_abil": "Focus", "base_abil": "Focus",
"parents": [ "parents": [
"More Focus II", "Cheaper Arrow Bomb II",
"Grape Bomb" "Grape Bomb"
], ],
"dependencies": [ "dependencies": [
@ -3837,7 +3837,7 @@ const atrees = {
"desc": "For every 100 Health Bonus you have from item IDs, gain +2% Fire Damage (Max 100%)", "desc": "For every 100 Health Bonus you have from item IDs, gain +2% Fire Damage (Max 100%)",
"archetype": "Paladin", "archetype": "Paladin",
"archetype_req": 0, "archetype_req": 0,
"parents": ["Ambidextrous", "Stronger Bash"], "parents": ["Precise Strikes", "Stronger Bash"],
"dependencies": [], "dependencies": [],
"blockers": [], "blockers": [],
"cost": 1, "cost": 1,
@ -3953,7 +3953,7 @@ const atrees = {
"archetype": "Battle Monk", "archetype": "Battle Monk",
"archetype_req": 4, "archetype_req": 4,
"base_abil": "Charge", "base_abil": "Charge",
"parents": ["Ambidextrous", "Burning Heart"], "parents": ["Precise Strikes", "Burning Heart"],
"dependencies": ["Flying Kick"], "dependencies": ["Flying Kick"],
"blockers": [], "blockers": [],
"cost": 2, "cost": 2,
@ -4071,7 +4071,7 @@ const atrees = {
"archetype": "Battle Monk", "archetype": "Battle Monk",
"archetype_req": 5, "archetype_req": 5,
"base_abil": "Uppercut", "base_abil": "Uppercut",
"parents": ["Ambidextrous", "Radiant Devotee"], "parents": ["Precise Strikes", "Radiant Devotee"],
"dependencies": ["Uppercut"], "dependencies": ["Uppercut"],
"blockers": [], "blockers": [],
"cost": 2, "cost": 2,

File diff suppressed because one or more lines are too long

View file

@ -293,13 +293,13 @@ function get_full_url() {
} }
function copyBuild() { function copyBuild() {
copyTextToClipboard(); copyTextToClipboard(get_full_url());
document.getElementById("copy-button").textContent = "Copied!"; document.getElementById("copy-button").textContent = "Copied!";
} }
function shareBuild(build) { function shareBuild(build) {
if (build) { if (build) {
let text = url_base+'?v='+wynn_version_id.toString()+location.hash+"\n"+ let text = get_full_url()+"\n"+
"WynnBuilder build:\n"+ "WynnBuilder build:\n"+
"> "+build.items[0].statMap.get("displayName")+"\n"+ "> "+build.items[0].statMap.get("displayName")+"\n"+
"> "+build.items[1].statMap.get("displayName")+"\n"+ "> "+build.items[1].statMap.get("displayName")+"\n"+

View file

@ -1175,11 +1175,15 @@ function builder_graph_init() {
if (atree_data !== null && atree_node.value !== null) { // janky check if atree is valid if (atree_data !== null && atree_node.value !== null) { // janky check if atree is valid
const atree_state = atree_state_node.value; const atree_state = atree_state_node.value;
if (atree_data.length > 0) { if (atree_data.length > 0) {
try {
const active_nodes = decode_atree(atree_node.value, atree_data); const active_nodes = decode_atree(atree_node.value, atree_data);
for (const node of active_nodes) { for (const node of active_nodes) {
atree_set_state(atree_state.get(node.ability.id), true); atree_set_state(atree_state.get(node.ability.id), true);
} }
atree_state_node.mark_dirty().update(); atree_state_node.mark_dirty().update();
} catch (e) {
console.log("Failed to decode atree. This can happen when updating versions. Give up!")
}
} }
} }