CommandHelper

CommandHelper

46.5k Downloads

or() is broken when given variables directly

LadyCailinBot opened this issue ยท 1 comments

commented

CMDHELPER-2854 - Reported by Z_

      @tr = (1 == 1)
      @fa = (1 == 2)
      console(@tr)
      console(@fa)
      console(or(@tr, @fa))
      console(@tr || @fa)
      console(or(true,false))
<<<```
Gives true, false, false, false, true.
See [here|http://cyanox.com/CH_or_patch.png], [here|http://paste.thezomg.com/12343/87376470/] for a more thorough test. As it always uses variables directly (line 5), or always returns false.

Fix is to change .eval [here|https://github.com/sk89q/commandhelper/blob/master/src/main/java/com/laytonsmith/core/functions/BasicLogic.java#L1405] to .seval, as with and(). Then variables are resolved properly, and or() works as expected. "After patch" results on those links confirm this.
commented

Comment by LadyCailin

Fixed in current build.