Loading

Paste #p930m0ow9

  1. diff --git a/nml/expression/functioncall.py b/nml/expression/functioncall.py
  2. --- a/nml/expression/functioncall.py
  3. +++ b/nml/expression/functioncall.py
  4. @@ -259,9 +259,9 @@ def builtin_getbits(name, args, pos):
  5.          raise generic.ScriptError(name + "() must have exactly three parameters", pos)
  6.  
  7.      # getbits(value, first, amount) = (value >> first) & ((0xFFFFFFFF << amount) ^ 0xFFFFFFFF)
  8. -    part1 = expression.BinOp(nmlop.SHIFTU_RIGHT, args[0], args[1], pos)
  9. -    part2 = expression.BinOp(nmlop.SHIFT_LEFT, expression.ConstantNumeric(0xFFFFFFFF), args[2], pos)
  10. -    part3 = expression.BinOp(nmlop.XOR, part2, expression.ConstantNumeric(0xFFFFFFFF), pos)
  11. +    part1 = BinOp(nmlop.SHIFTU_RIGHT, args[0], args[1], pos)
  12. +    part2 = BinOp(nmlop.SHIFT_LEFT, ConstantNumeric(0xFFFFFFFF), args[2], pos)
  13. +    part3 = BinOp(nmlop.XOR, part2, ConstantNumeric(0xFFFFFFFF), pos)
  14.  
  15.      return BinOp(nmlop.AND, part1, part3, pos)

Comments