[Scummvm-git-logs] scummvm master -> 2cae1bec12c316fdb9a2b034c5e2d80c48eb5b91

dreammaster noreply at scummvm.org
Sat Jun 22 16:52:23 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2cae1bec12 ULTIMA6: patch nuvie.cfg parsing by extracting text from child


Commit: 2cae1bec12c316fdb9a2b034c5e2d80c48eb5b91
    https://github.com/scummvm/scummvm/commit/2cae1bec12c316fdb9a2b034c5e2d80c48eb5b91
Author: Yudhi Widyatama (yudhi.widyatama at gmail.com)
Date: 2024-06-22T09:52:20-07:00

Commit Message:
ULTIMA6: patch nuvie.cfg parsing by extracting text from child

Re-enables nuvie.cfg file parsing that were impacted by XMLNode
enhancement, picking the text value of first child if current
subtree text is empty. Fixes issue #15207.

Changed paths:
    engines/ultima/shared/conf/xml_tree.cpp


diff --git a/engines/ultima/shared/conf/xml_tree.cpp b/engines/ultima/shared/conf/xml_tree.cpp
index 5d76970ff7e..eebd87e39b8 100644
--- a/engines/ultima/shared/conf/xml_tree.cpp
+++ b/engines/ultima/shared/conf/xml_tree.cpp
@@ -130,8 +130,12 @@ bool XMLTree::checkRoot(const Common::String &key) const {
 void XMLTree::value(const Common::String &key, Common::String &ret,
 					const char *defaultvalue) const {
 	const XMLNode *sub = _tree->subtree(key);
-	if (sub)
+	if (sub) { 
 		ret = sub->text();
+		if (ret.empty())
+			if (sub->firstChild())
+				ret = sub->firstChild()->text();
+	}	
 	else
 		ret = defaultvalue;
 }




More information about the Scummvm-git-logs mailing list