diff --git a/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetCondition.java b/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetCondition.java index e50566b70..caa631b28 100644 --- a/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetCondition.java +++ b/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetCondition.java @@ -95,8 +95,13 @@ public void getTooltip(List curTooltip) { @Override public void addErrors(List curInfo, List widgets) { super.addErrors(curInfo, widgets); + + IProgWidget textTrue = getConnectedParameters()[getParameters().size() - 1]; + IProgWidget textFalse = getConnectedParameters()[getParameters().size() * 2 - 1]; if (getMeasureVar().isEmpty() && getConnectedParameters()[getParameters().size() - 1] == null && getConnectedParameters()[getParameters().size() * 2 - 1] == null) { curInfo.add(xlate("pneumaticcraft.gui.progWidget.condition.error.noFlowControl")); + } else if (getOutputWidget() != null && textTrue != null && textFalse != null) { + curInfo.add(xlate("pneumaticcraft.gui.progWidget.condition.error.badFlowControl")); } } diff --git a/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetConditionBase.java b/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetConditionBase.java index f3f57cc01..b1c328eb1 100644 --- a/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetConditionBase.java +++ b/src/main/java/me/desht/pneumaticcraft/common/drone/progwidgets/ProgWidgetConditionBase.java @@ -55,13 +55,15 @@ public WidgetDifficulty getDifficulty() { @Override public void addErrors(List curInfo, List widgets) { super.addErrors(curInfo, widgets); - IProgWidget widget = getConnectedParameters()[getParameters().size() - 1]; - IProgWidget widget2 = getConnectedParameters()[getParameters().size() * 2 - 1]; + IProgWidget textTrue = getConnectedParameters()[getParameters().size() - 1]; + IProgWidget textFalse = getConnectedParameters()[getParameters().size() * 2 - 1]; boolean hasMeasureVar = this instanceof ICondition cond && !cond.getMeasureVar().isEmpty(); - if (widget == null && widget2 == null && !hasMeasureVar) { + if (textTrue == null && textFalse == null && !hasMeasureVar) { curInfo.add(xlate("pneumaticcraft.gui.progWidget.condition.error.noFlowControl")); - } else if (widget != null && !(widget instanceof ProgWidgetText) || widget2 != null && !(widget2 instanceof ProgWidgetText)) { + } else if (textTrue != null && !(textTrue instanceof ProgWidgetText) || textFalse != null && !(textFalse instanceof ProgWidgetText)) { curInfo.add(xlate("pneumaticcraft.gui.progWidget.condition.error.shouldConnectTextPieces")); + } else if (getOutputWidget() != null && textTrue != null && textFalse != null) { + curInfo.add(xlate("pneumaticcraft.gui.progWidget.condition.error.badFlowControl")); } } diff --git a/src/main/resources/assets/pneumaticcraft/lang/en_us.json b/src/main/resources/assets/pneumaticcraft/lang/en_us.json index 4e38e3c14..3a73a255f 100644 --- a/src/main/resources/assets/pneumaticcraft/lang/en_us.json +++ b/src/main/resources/assets/pneumaticcraft/lang/en_us.json @@ -1303,6 +1303,7 @@ "pneumaticcraft.gui.progWidget.conditionBlock.checkForLiquids" : "Check for Liquids", "pneumaticcraft.gui.progWidget.conditionBlock.checkForLiquids.tooltip" : "Special condition. When checked, a block passes the filter when it's a liquid.", "pneumaticcraft.gui.progWidget.conditionCoordinate.error.noAxisSelected" : "No checking axis selected. You need to check at least one condition for its value for the condition to work.", + "pneumaticcraft.gui.progWidget.condition.error.badFlowControl" : "With branch labels on both right (true) and left (false), the widget below is never used!", "pneumaticcraft.gui.progWidget.condition.error.noFlowControl" : "No output label selected. The flow will continue downwards, regardless of the outcome of the condition.", "pneumaticcraft.gui.progWidget.condition.error.shouldConnectTextPieces" : "You should only connect Text puzzle pieces that reference a Label puzzle piece with a text piece.", "pneumaticcraft.gui.progWidget.condition.anyBlock" : "Any Block",