Fixed wrong node usage for instance loading

Noticed because of #7654
This commit is contained in:
Lemongrass3110 2023-03-19 19:10:42 +01:00
parent 36972bf9ea
commit b95daa3041

View File

@ -195,14 +195,14 @@ uint64 InstanceDatabase::parseBodyNode(const ryml::NodeRef& node) {
return 0;
if (x == 0) {
this->invalidWarning(node["X"], "X has to be greater than zero.\n");
this->invalidWarning(enterNode["X"], "X has to be greater than zero.\n");
return 0;
}
map_data *md = map_getmapdata(instance->enter.map);
if (x >= md->xs) {
this->invalidWarning(node["X"], "X has to be smaller than %hu.\n", md->xs);
this->invalidWarning(enterNode["X"], "X has to be smaller than %hu.\n", md->xs);
return 0;
}
@ -216,14 +216,14 @@ uint64 InstanceDatabase::parseBodyNode(const ryml::NodeRef& node) {
return 0;
if (y == 0) {
this->invalidWarning(node["Y"], "Y has to be greater than zero.\n");
this->invalidWarning(enterNode["Y"], "Y has to be greater than zero.\n");
return 0;
}
map_data *md = map_getmapdata(instance->enter.map);
if (y >= md->ys) {
this->invalidWarning(node["Y"], "Y has to be smaller than %hu.\n", md->ys);
this->invalidWarning(enterNode["Y"], "Y has to be smaller than %hu.\n", md->ys);
return 0;
}