summaryrefslogtreecommitdiff
path: root/games/0ad/files/patch-source_tools_atlas_AtlasObject_AtlasObjectImpl.cpp
blob: b67f4c71c6e6e776fa7ff384518bef55f090705f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp.orig	2016-11-23 14:09:58 UTC
+++ source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp
@@ -164,7 +164,12 @@ void AtObj::add(const char* key, AtObj& data)
 
 void AtObj::add(const char* key, const wxString& value)
 {
-	add(key, value.wc_str());
+	const AtNode* o = new AtNode(value.wc_str());
+
+	if (!p)
+		p = new AtNode();
+
+	p = p->addChild(key, AtNode::Ptr(o));
 }
 
 void AtObj::add(const char* key, const wchar_t* value)
@@ -187,7 +192,12 @@ void AtObj::set(const char* key, AtObj& data)
 
 void AtObj::set(const char* key, const wxString& value)
 {
-	set(key, value.wc_str());
+	const AtNode* o = new AtNode(value.wc_str());
+
+	if (!p)
+		p = new AtNode();
+
+	p = p->setChild(key, AtNode::Ptr(o));
 }
 
 void AtObj::set(const char* key, const wchar_t* value)