From 532dbee4fd0efd20ce6d46a2c486cc9293a4440c Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 18 Feb 2021 18:36:41 -0800 Subject: [PATCH] Contextualize PHYSFS_mountHandle() failure output If PHYSFS_mountHandle() failed to mount a zip file, we would print PhysFS's error message straight, without any surrounding context. This seems a little weird, and doesn't maximize understanding for readers; I've made it so now the error message is "Could not mount : ". --- desktop_version/src/editor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 0be8caac..ff41995f 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -87,7 +87,11 @@ void editorclass::loadZips() if (endsWith(directoryList[i], ".zip")) { PHYSFS_File* zip = PHYSFS_openRead(directoryList[i].c_str()); if (!PHYSFS_mountHandle(zip, directoryList[i].c_str(), "levels", 1)) { - printf("%s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + printf( + "Could not mount %s: %s\n", + filename_.c_str(), + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); } else { needsReload = true; }