Loading

Paste #phnoopups

  1. diff --git a/nml/actions/action0properties.py b/nml/actions/action0properties.py
  2. index eebfd95..53da8c3 100644
  3. --- a/nml/actions/action0properties.py
  4. +++ b/nml/actions/action0properties.py
  5. @@ -751,7 +751,7 @@ def industry_prod_multiplier(value):
  6.              props.append(Action0Property(0x12 + i, val, 1))
  7.          return props
  8.      else:
  9. -        return [ByteListProp(0x27, [value.values])]
  10. +        return [ByteListProp(0x27, [[i.reduce_constant().value for i in value.values]])]
  11.  
  12.  class RandomSoundsProp(BaseAction0Property):
  13.      def __init__(self, sound_list):
  14. @@ -821,15 +821,15 @@ def industry_input_multiplier_ext(value):
  15.          raise generic.ScriptError("Input multiplier must be an array with a multiple of 3 values", value.pos)
  16.      multipliers = []
  17.      max_in, max_out = 0, 0
  18. -    for i in range(len(value.values) / 3):
  19. +    for i in range(len(value.values) // 3):
  20.          in_slot, out_slot, mul = value.values[i*3:i*3+3]
  21.          if not (isinstance(in_slot, ConstantNumeric) and isinstance(out_slot, ConstantNumeric) and isinstance(mul, (ConstantNumeric, ConstantFloat))):
  22.              raise generic.ScriptError("Expected a compile-time constant (triplets of int/int/float)", value.pos)
  23. -        check_range(in_slot.value, 0, 16, "input_multiplier slot", in_slot.pos)
  24. -        check_range(out_slot.value, 0, 16, "input_multiplier slot", out_slot.pos)
  25. -        check_range(mul.value, 0, 256, "input_multiplier value", mul.pos)
  26. +        generic.check_range(in_slot.value, 0, 16, "input_multiplier slot", in_slot.pos)
  27. +        generic.check_range(out_slot.value, 0, 16, "input_multiplier slot", out_slot.pos)
  28. +        generic.check_range(mul.value, 0, 256, "input_multiplier value", mul.pos)
  29.          max_in, max_out = max(max_in, in_slot.value), max(max_out, out_slot.value)
  30. -        multipliers = multipliers + [(in_slot.value, out_slot.value, int(mul.value * 256)]
  31. +        multipliers = multipliers + [(in_slot.value, out_slot.value, int(mul.value * 256))]
  32.      if max_in < 3 and max_out < 2:
  33.          # old properties
  34.          tbl = [[0, 0], [0, 0], [0, 0]]

Comments