Closed Jampi0n closed 3 years ago
Just for information, why wouldn't you use the ErrorHandling
package?
I tried to construct minimal examples to reproduce errors. Using NoWurst the generated map script is smaller and easier to debug.
In this case I tried to come up with the example of #994 and noticed that the map doesn't load without _Handles
. Then I did more tests and noticed, that it's because of ErrorHandling
.
For normal maps I always use ErrorHandling
.
How exactly does this check whether debugPrint is available?
The intermediate program already checks whether ErrorHandling is available.
imError is the function which calls the error function. It searches for the error function with findErrorFunc
, which returns the error function from ErrorHandling if available. Otherwise a default error function will be used. This default function also contains a call to $debugPrint.
The translation from $debugPrint to BJDebugMsg was missing in lua. It exists in JASS as you can see in the link I posted above.
In lua, init blocks result in incorrect map scripts, if the package ErrorHandling is not used. In particular, the print function inside the error function will be "$debugPrint". The $ character causes the map to not load.
This change is based on the jass expression translation here: ExprTranslation.java
This change only has an effect if ErrorHandling is not used. Then the call to "$debugPrint" is replaced with "BJDebugMsg" like in the jass expression translator.