@@ -31,7 +31,7 @@ Node Load(std::istream& input) {
Node LoadFile(const std::string& filename) {
std::ifstream fin(filename.c_str());
- if (fin.bad()) {
+ if (!fin || fin.bad()) {
throw BadFile();
}
return Load(fin);
@@ -76,3 +76,5 @@
###########################################################################
# Score - Achievement points that are given on completion.
+
+Achievements:
@@ -45,9 +45,7 @@ yamlwrapper* yaml_load_file(const char* file_name) {
try {
node = YAML::LoadFile(file_name);
- if (!node.IsDefined())
- return NULL;
- if (node.IsNull())
+ if (!node.IsDefined() || node.IsNull())
return NULL;
} catch (YAML::ParserException &e) {
ShowError("YAML Exception Caught: %s\n", e.what());