SethBling / cbscript

CBScript for Minecraft
1.13k stars 28 forks source link

bug: `KeyError: 'scale'` upon compilation of script #27

Open AgentM12 opened 3 months ago

AgentM12 commented 3 months ago

I encounter the following error when running the compile.py:

Compiler encountered unexpected error during compilation:
Traceback (most recent call last):
  File "D:\Dev\Minecraft\CBScript\cbscript\cbscript.py", line 70, in try_to_compile
    success = self.compile_all()
  File "D:\Dev\Minecraft\CBScript\cbscript\cbscript.py", line 106, in compile_all
    global_environment.set_dollarid('global_scale', parsed['scale'])
KeyError: 'scale'

This can be resolved by defining the scale 1 in your cbscript. I don't know what this scale is used for, so it might be a good idea to give it an implicit default value of 1 (or whatever is the most sensible default) rather than failing the compilation.

CoolCat467 commented 2 months ago

15 has a fix for this among it's other changes, but might work better factored out into it's own pull request.