projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11372ac
)
Schematics: Error if unable to open file
author
kwolekr
<kwolekr@minetest.net>
Tue, 24 Mar 2015 01:03:28 +0000
(21:03 -0400)
committer
kwolekr
<kwolekr@minetest.net>
Tue, 24 Mar 2015 02:22:14 +0000
(22:22 -0400)
src/mg_schematic.cpp
patch
|
blob
|
history
diff --git
a/src/mg_schematic.cpp
b/src/mg_schematic.cpp
index a05e372e51c43e6e3908cc3ddf4bc80b5d2e5333..23b62115f2078b6ebe19d1bb7add1756f8e87c35 100644
(file)
--- 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) {