-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Current behavior
Currently, when a .mds file contains an *event element without curly brackets, parsing will fail with this exception and not returning the .mds object:
level=Error, name=<Native>, message=ZkModelScript_load() failed: failed parsing resource of type ModelScript (source) [context: MDS syntax error
It seems to be caused by this line of code which expects RBRACE before parsing *event elements. If brackets aren't there, the upcoming lines will be treated as new keywords but not the events itself.
Reproduction
- Used ZenKit version = 1.0.3.0
- Use a custom .mds file (example below)
- Try to parse it
Example part which is causing the error:
Model ("HuS")
{
...
aniEnum
{
...
//3. Transition zum Loop
ani ("s_Moers_S1" 1 "s_Moers_S1" 0.0 0.0 M. "Hum_Moerser_Ani.ASC" F 28 40 FPS:25)
*eventTag (8 "DEF_DESTROY_ITEM")
//4. Loop
ani ("s_Moers_S1" 1 "s_Moers_S1" 0.0 0.0 M. "Hum_Moerser_Ani.ASC" F 28 40 FPS:25)
...
}
}Expected behavior
Disclaimer: I found this parsing error by testing with a WIP Gothic Mod. Yes, it's an issue on the mod's side to not have the brackets there as expected, but parsing should go on as it is doing in G2 too.
Gothic 2 behavior seems to simply ignore these elements by skipping them (I tested it by starting the game with such an invalid event element. Therefore I'd like to ask if ZenKit can throw a warning about it or simply ignoring it too.