summaryrefslogtreecommitdiff
path: root/src/mg_schematic.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-03-23 21:03:28 -0400
committerkwolekr <kwolekr@minetest.net>2015-03-23 22:22:14 -0400
commita423202756744c4f09488762ed35ab24693b0f20 (patch)
tree206e3fc6d41d0fbff360b78546b58472a4d1611d /src/mg_schematic.cpp
parent11372ac646440c789ac568133699a20938e33dad (diff)
downloadminetest-a423202756744c4f09488762ed35ab24693b0f20.tar.gz
minetest-a423202756744c4f09488762ed35ab24693b0f20.tar.bz2
minetest-a423202756744c4f09488762ed35ab24693b0f20.zip
Schematics: Error if unable to open file
Diffstat (limited to 'src/mg_schematic.cpp')
-rw-r--r--src/mg_schematic.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mg_schematic.cpp b/src/mg_schematic.cpp
index a05e372e5..23b62115f 100644
--- a/src/mg_schematic.cpp
+++ b/src/mg_schematic.cpp
@@ -207,6 +207,11 @@ bool Schematic::loadSchematicFromFile(const char *filename, INodeDefManager *nde
bool have_cignore = false;
std::ifstream is(filename, std::ios_base::binary);
+ if (!is.good()) {
+ errorstream << "loadSchematicFile: unable to open file '"
+ << filename << "'" << std::endl;
+ return false;
+ }
u32 signature = readU32(is);
if (signature != MTSCHEM_FILE_SIGNATURE) {