rem: if (selection[0].traits.armour.hack && selection[0].traits.armour.hack > 0) 
add: if (selection[0].traits.armour && selection[0].traits.armour.hack && selection[0].traits.armour.hack > 0) 
context: function UpdateStatusOrb(){	// Update heading.	GUIObject = getGUIObjectByName("session_panel_status_heading");	GUIObject.caption = "Acumen"; // Player name (placeholder; replace with proper callsign).	if (selection[0].traits.id.civ)		GUIObject.caption += " [icon=bullet_icon] " + selection[0].traits.id.civ;	// Update name text.	GUIObject = getGUIObjectByName("session_panel_status_name1");	GUIObject.caption = "";	// Personal name.	if (selection[0].traits.id.personal && selection[0].traits.id.personal != "")	{		GUIObject.caption += selection[0].traits.id.personal + "\n";	}	// Generic name.	if (selection[0].traits.id.generic)	{		GUIObject.caption += selection[0].traits.id.generic + "\n";	}	// Specific/ranked name.	if (selection[0].traits.id.ranked)	{		GUIObject = getGUIObjectByName("session_panel_status_name1");		GUIObject.caption += selection[0].traits.id.ranked + "\n";	}	else{		if (selection[0].traits.id.specific)		{			GUIObject.caption += selection[0].traits.id.specific + "\n";		}	}	// Update portrait	if (selection[0].traits.id.icon)	{		if (selection[0].traits.id.icon_cell && selection[0].traits.id.icon_cell != "")			setPortrait("session_panel_status_portrait", selection[0].traits.id.icon + "_" + selection[0].traits.id.icon_cell);		else			setPortrait("session_panel_status_portrait", selection[0].traits.id.icon);	}	// Update rank.	if (selection[0].traits.up.rank > 1)	{		getGUIObjectByName("session_panel_status_icon_rank").sprite = "statistic_rank" + (selection[0].traits.up.rank-1);	}	else		getGUIObjectByName("session_panel_status_icon_rank").sprite = "";	// Update hitpoints	if (selection[0].traits.health.curr && selection[0].traits.health.max)	{		getGUIObjectByName("session_panel_status_icon_hp_text").caption = Math.round(selection[0].traits.health.curr) + "/" + Math.round(selection[0].traits.health.max);		getGUIObjectByName("session_panel_status_icon_hp_text").hidden = false;		getGUIObjectByName("session_panel_status_icon_hp_bar").caption = ((Math.round(selection[0].traits.health.curr) * 100 ) / Math.round(selection[0].traits.health.max));		getGUIObjectByName("session_panel_status_icon_hp_bar").hidden = false;	}	else	{		getGUIObjectByName("session_panel_status_icon_hp_text").hidden = true;		getGUIObjectByName("session_panel_status_icon_hp_bar").hidden = true;	}	// Update upgrade points	if (selection[0].traits.up && selection[0].traits.up.curr && selection[0].traits.up.req)	{		getGUIObjectByName("session_panel_status_icon_xp_text").caption = Math.round(selection[0].traits.up.curr) + "/" + Math.round(selection[0].traits.up.req);		getGUIObjectByName("session_panel_status_icon_xp_text").hidden = false;		getGUIObjectByName("session_panel_status_icon_xp_bar").caption = ((Math.round(selection[0].traits.up.curr) * 100 ) / Math.round(selection[0].traits.up.req));		getGUIObjectByName("session_panel_status_icon_xp_bar").hidden = false;	}	else	{		getGUIObjectByName("session_panel_status_icon_xp_text").hidden = true;		getGUIObjectByName("session_panel_status_icon_xp_bar").hidden = true;	}	// Update Supply/Garrison	GUIObject = getGUIObjectByName("session_panel_status_stat1");	GUIObject.caption = '';	if (selection[0].traits.garrison)	{		if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max)		{			GUIObject.caption += '[icon="icon_statistic_garrison"] [color="100 100 255"]' + selection[0].traits.garrison.curr + '/' + selection[0].traits.garrison.max + '[/color] ';		}	}	if (selection[0].traits.supply)	{		if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type)		{			// Special case for infinity.			if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0")				GUIObject.caption += '[icon="icon_resource_' + selection[0].traits.supply.type + '"] [color="100 100 255"] [icon="infinity_icon"] [/color] ';			else				GUIObject.caption += '[icon="icon_resource_' + selection[0].traits.supply.type + '"] [color="100 100 255"]' + selection[0].traits.supply.curr + '/' + selection[0].traits.supply.max + '[/color] ';		}	}	// Update Attack stats	if (selection[0].actions.attack)	{		if (selection[0].actions.attack.damage && selection[0].actions.attack.damage > 0)			getGUIObjectByName("session_panel_status_stat1_1").caption = '[icon="icon_statistic_attack"]' + selection[0].actions.attack.damage;		else			getGUIObjectByName("session_panel_status_stat1_1").caption = "";		if (selection[0].actions.attack.hack && selection[0].actions.attack.hack > 0)			getGUIObjectByName("session_panel_status_stat2_1").caption = '[icon="icon_statistic_hack"]' + Math.round(selection[0].actions.attack.hack*100) + '%';		else			getGUIObjectByName("session_panel_status_stat2_1").caption = "";		if (selection[0].actions.attack.pierce && selection[0].actions.attack.pierce > 0)			getGUIObjectByName("session_panel_status_stat3_1").caption = '[icon="icon_statistic_pierce"]' + Math.round(selection[0].actions.attack.pierce*100) + '%';		else			getGUIObjectByName("session_panel_status_stat3_1").caption = "";		if (selection[0].actions.attack.crush && selection[0].actions.attack.crush > 0)			getGUIObjectByName("session_panel_status_stat4_1").caption = '[icon="icon_statistic_crush"]' + Math.round(selection[0].actions.attack.crush*100) + '%';		else			getGUIObjectByName("session_panel_status_stat4_1").caption = "";		if (selection[0].actions.attack.range && selection[0].actions.attack.range > 0)			getGUIObjectByName("session_panel_status_stat5_1").caption = '[icon="icon_statistic_range"]' + selection[0].actions.attack.range;		else			getGUIObjectByName("session_panel_status_stat5_1").caption = "";		if (selection[0].actions.attack.accuracy && selection[0].actions.attack.accuracy > 0)			getGUIObjectByName("session_panel_status_stat6_1").caption = '[icon="icon_statistic_accuracy"]' + Math.round(selection[0].actions.attack.accuracy*100) + '%';		else			getGUIObjectByName("session_panel_status_stat6_1").caption = "";	}	// Update Armour & Other stats	if (selection[0].traits.armour)	{		if (selection[0].traits.armour.value && selection[0].traits.armour.value > 0)			getGUIObjectByName("session_panel_status_stat1_2").caption = '[icon="icon_statistic_armour"]' + selection[0].traits.armour.value;		else getGUIObjectByName("session_panel_status_stat1_2").caption = "";		if (selection[0].traits.armour.hack && selection[0].traits.armour.hack > 0)			getGUIObjectByName("session_panel_status_stat2_2").caption = '[icon="icon_statistic_hack"]' + Math.round(selection[0].traits.armour.hack*100) + '%';		else getGUIObjectByName("session_panel_status_stat2_2").caption = "";		if (selection[0].traits.armour.pierce && selection[0].traits.armour.pierce > 0)			getGUIObjectByName("session_panel_status_stat3_2").caption = '[icon="icon_statistic_pierce"]' + Math.round(selection[0].traits.armour.pierce*100) + '%';		else getGUIObjectByName("session_panel_status_stat3_2").caption = "";		if (selection[0].traits.armour.crush && selection[0].traits.armour.crush > 0)			getGUIObjectByName("session_panel_status_stat4_2").caption = '[icon="icon_statistic_crush"]' + Math.round(selection[0].traits.armour.crush*100) + '%';		else getGUIObjectByName("session_panel_status_stat4_2").caption = "";	}	if (selection[0].actions.move && selection[0].actions.move.speed)		getGUIObjectByName("session_panel_status_stat5_2").caption = '[icon="icon_statistic_speed"]' + selection[0].actions.move.speed;		else getGUIObjectByName("session_panel_status_stat5_2").caption = "";	if (selection[0].traits.vision && selection[0].traits.vision.los)		getGUIObjectByName("session_panel_status_stat6_2").caption = '[icon="icon_statistic_los"]' + selection[0].traits.vision.los;		else getGUIObjectByName("session_panel_status_stat6_2").caption = "";	// Reveal Status Orb	getGUIObjectByName("session_status_orb").hidden = false;	// Update Command Buttons.	UpdateCommandButtons();}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/8ce263a002c670727dff679af908b700e9225b80/functions_session_status_orb.js/clean/binaries/data/mods/official/gui/test/functions_session_status_orb.js