- if ( detect_click_position((int)event->x, (int)event->y ) == IN && CItem::gate_id != ID ) {
+ if ( detect_click_position((int)event->x, (int)event->y ) == IN && CItem::gate_id != ID && !workplace->get_logic_item(CItem::gate_id)->get_out_logic_connect()) {