From 2dcc781681c73732fda1f9b4fb1bfefa833af58e Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Fri, 26 Jun 2020 23:25:28 +0930 Subject: Logic: inputs can no longer be connected to inputs --- MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index 40bb384..01d14ef 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -732,14 +732,14 @@ MainWindow::on_left_mouse_up(FXObject*, FXSelector, void *ptr) gate = find_gate_at(ev->last_x, ev->last_y); if (gate == selected_gate) /* gates cannot connect to themselves, probably */ return 1; - if (gate) + if (gate && gate->get_gate_type() != Gate::INPUT) { int input = -1; if (ev->last_y-gate->get_y() <= gate->get_height()/2) input = 1; else input = 2; - if (gate->get_gate_type() != Gate::NOT && gate->get_gate_type() && gate->get_gate_type() != Gate::OUTPUT) + if (gate->get_gate_type() != Gate::NOT && gate->get_gate_type() != Gate::OUTPUT) { printf("connecting gate %d with gate %d at input #%d\n", selected_gate->get_id(), gate->get_id(), input); if (input == 1) -- cgit v1.2.3