phoboslab / Impact

HTML5 Game Engine
MIT License
1.99k stars 204 forks source link

Weltmeister produces invalid level JSON #90

Open Joncom opened 2 years ago

Joncom commented 2 years ago

Weltmeister will produce invalid level JSON if a double-quote is used anywhere in the settings of one of your entities.

For example: Say you have an Entity called EntityText, and it has a text property with a value of "Hello". These double-quotes will seem to work fine, but when you save, the JSON produced will be invalid. And when you refresh and try to reload the level, the level will not parse.

This is caused by a bug in JSONFormat: https://github.com/phoboslab/Impact/blob/ca59f0e1a443a2667c5c0579ae74fdb67a1c3dcb/lib/weltmeister/weltmeister.js#L410-L413

Bug details and a fix can be found here: https://github.com/phoboslab/json-format/issues/2