When using the demo filter and the selected demo name does not match any visible demo item, temporarily reset the selected demo index instead of keeping an incorrect demo index. This makes the behavior consistent with the server browser.
The popup to show the completed demo rendering was also shown when the demo to be rendered could not be loaded or if the demo render popup was cancelled. Now the popup is only shown when the demo rendering was successful.
The layout of the popup is made consistent with other message popups. Long text is wrapped over multiple lines instead of decreasing the font size.
Simplify the usage of datafile reader and writer by adding utility functions to read and write zero-terminated UTF-8 strings.
Improve validation of string data read from datafiles. It is ensure that string data is null-terminated, has no internal NUL-characters and is valid UTF-8.
Fix loading of external sounds in the editor. The wrong path variable was being used, so the sound files would not be loaded from correct folder.
Add tests for new datafile reader/writer functions.
When `IMap::Load` fails, other components will continue to use the old map. However, if `IMap::Load` failed after the map was already successfully read with the datafile reader then other components kept their pointers to the old, invalid datafile reader items and data, causing random crashes in collision code. This is fixed by using a separate datafile reader to read the new map and only applying the datafile reader globally when loading was entirely successfully.
An error message is added for the case that a map has an unsupported version, which is currently the only case where a map can fail to load after the datafile was read successfully.
In particular, the block maps `blmapPepe`, `blmapV5` and `blmapDT-UPTU` did not have a version map item and were fixed separately.
Closes#7218. Regression from #5737.
Add error message in editor when loading a map that has an unsupported version.
Ensure error messages are not closed immediately when loading a map fails.
Remove unnecessary indentation by returning early.