Skip to content
Permalink
Browse files

Schematics: Error if unable to open file

  • Loading branch information
kwolekr committed Mar 24, 2015
1 parent 11372ac commit a423202756744c4f09488762ed35ab24693b0f20
Showing with 5 additions and 0 deletions.
  1. +5 −0 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) {

0 comments on commit a423202

Please sign in to comment.