mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-07-28 01:51:49 +03:00
3ef5248db9
All XML functions now check the return value of tinyxml2::XMLDocument::Error() after each document gets loaded in to TinyXML-2. If there's an error, then all functions return. This isn't strictly necessary, but printing the error message that TinyXML-2 is the bare minimum we could do to be useful. Additionally, I've standardized the error messages of missing or corrupted XML files. Also, the way the game went about making the XML handles was... a bit roundabout. There were two XML handles, one for the document and one for the root element - although only one XML handle suffices. So I've cleaned that up too. I could've gone further and added error checking for a whole bunch of things (e.g. missing elements, missing attributes), but this is good enough. Also, if unlock.vvv or settings.vvv don't exist yet, the game is guaranteed to no-op instead of continuing with the function. Nothing bad seems to happen if the function continues, but the return statements should be there anyway to clearly indicate intent.