diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/CalculatorManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/CalculatorManager.java index f727838..46bc429 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/CalculatorManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/CalculatorManager.java @@ -55,12 +55,17 @@ public class CalculatorManager implements Listener { { try { message = message.substring(1); - - // TODO prendre en compte les variables "resX" + + int i = history.size(); + for(HistoryElement el : history) + { + message = message.replace("res"+i, el.value); + i--; + } - StringBuffer expression = new StringBuffer(); + StringBuffer expression = new StringBuffer(); // permet de stocker la version reformaté de l'expression mathématique HistoryElement calcul = new HistoryElement(); calcul.value = StringUtil.formatDouble(JArithmeticInterpreter.getResultFromExpression(message, expression));