// auto-transcompiled — see *.dnd.json for canonical truth
if(global.iv_sellevel == 2)
{
global.iv_selx = 0;
global.iv_sely = 0;
}
else if(global.iv_sellevel == 3)
{
global.iv_action = 0;
}

if(global.iv_sellevel == 1 || (global.iv_sellevel == 2 && global.iv_tabindex != 0))
{
global.iv_sellevel = 0;
}
else if(global.iv_sellevel != 0)
{
global.iv_sellevel -= 1;
if(global.iv_sellevel == 2) iv_setactions(iv_tabcol2db());
}

if(global.iv_sellevel < 2)
{
iv_infochange();
iv_formattable(iv_tabcol2db());
}
