mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Schematics: Error if unable to open file
This commit is contained in:
parent
11372ac646
commit
a423202756
1 changed files with 5 additions and 0 deletions
|
@ -207,6 +207,11 @@ bool Schematic::loadSchematicFromFile(const char *filename, INodeDefManager *nde
|
||||||
bool have_cignore = false;
|
bool have_cignore = false;
|
||||||
|
|
||||||
std::ifstream is(filename, std::ios_base::binary);
|
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);
|
u32 signature = readU32(is);
|
||||||
if (signature != MTSCHEM_FILE_SIGNATURE) {
|
if (signature != MTSCHEM_FILE_SIGNATURE) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue