Follow up to dcbb2df
* Adjusted the checks to one-line. * Corrected the map-server from spitting out an error for the achievements import file.
This commit is contained in:
parent
dcbb2df776
commit
ac1cf0499a
2
3rdparty/yaml-cpp/src/parse.cpp
vendored
2
3rdparty/yaml-cpp/src/parse.cpp
vendored
@ -31,7 +31,7 @@ Node Load(std::istream& input) {
|
|||||||
|
|
||||||
Node LoadFile(const std::string& filename) {
|
Node LoadFile(const std::string& filename) {
|
||||||
std::ifstream fin(filename.c_str());
|
std::ifstream fin(filename.c_str());
|
||||||
if (fin.bad()) {
|
if (!fin || fin.bad()) {
|
||||||
throw BadFile();
|
throw BadFile();
|
||||||
}
|
}
|
||||||
return Load(fin);
|
return Load(fin);
|
||||||
|
@ -76,3 +76,5 @@
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
# Score - Achievement points that are given on completion.
|
# Score - Achievement points that are given on completion.
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
|
Achievements:
|
||||||
|
@ -45,9 +45,7 @@ yamlwrapper* yaml_load_file(const char* file_name) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
node = YAML::LoadFile(file_name);
|
node = YAML::LoadFile(file_name);
|
||||||
if (!node.IsDefined())
|
if (!node.IsDefined() || node.IsNull())
|
||||||
return NULL;
|
|
||||||
if (node.IsNull())
|
|
||||||
return NULL;
|
return NULL;
|
||||||
} catch (YAML::ParserException &e) {
|
} catch (YAML::ParserException &e) {
|
||||||
ShowError("YAML Exception Caught: %s\n", e.what());
|
ShowError("YAML Exception Caught: %s\n", e.what());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user