Index: layer_ui.c =================================================================== --- layer_ui.c (revision 18338) +++ layer_ui.c (revision 18339) @@ -114,7 +114,8 @@ { void **p; #warning TODO: switch to unique IDs - p = vtp0_get(&pcb_uilayers, ui_ly_id, 0); + + p = vtp0_get(&pcb_uilayers, (ui_ly_id & (PCB_LYT_UI-1)), 0); if (p == NULL) return NULL; return (pcb_layer_t *)(*p);