parent
61c2480d89
commit
782299112b
@ -14105,20 +14105,12 @@ const std::string PlayerStatPointDatabase::getDefaultLocation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64 PlayerStatPointDatabase::parseBodyNode(const ryml::NodeRef& node) {
|
uint64 PlayerStatPointDatabase::parseBodyNode(const ryml::NodeRef& node) {
|
||||||
if (!this->nodesExist(node, { "Level", "Points" })) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16 level;
|
uint16 level;
|
||||||
|
|
||||||
if (!this->asUInt16(node, "Level", level))
|
if (!this->asUInt16(node, "Level", level))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint32 point;
|
|
||||||
|
|
||||||
if (!this->asUInt32(node, "Points", point))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
this->invalidWarning(node["Level"], "The minimum level is 1.\n");
|
this->invalidWarning(node["Level"], "The minimum level is 1.\n");
|
||||||
return 0;
|
return 0;
|
||||||
@ -14133,9 +14125,22 @@ uint64 PlayerStatPointDatabase::parseBodyNode(const ryml::NodeRef& node) {
|
|||||||
bool exists = entry != nullptr;
|
bool exists = entry != nullptr;
|
||||||
|
|
||||||
if( !exists ){
|
if( !exists ){
|
||||||
|
if( !this->nodesExist( node, { "Points" } ) ){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
entry = std::make_shared<s_statpoint_entry>();
|
entry = std::make_shared<s_statpoint_entry>();
|
||||||
entry->level = level;
|
entry->level = level;
|
||||||
entry->statpoints = point;
|
}
|
||||||
|
|
||||||
|
if( this->nodeExists( node, "Points" ) ){
|
||||||
|
uint32 points;
|
||||||
|
|
||||||
|
if( !this->asUInt32( node, "Points", points ) ){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry->statpoints = points;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this->nodeExists( node, "TraitPoints" ) ){
|
if( this->nodeExists( node, "TraitPoints" ) ){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user