Browse Source

Apply component ID save fix from vivienneanthony. Also verify that JSON save works similarly. Closes #1150.

Lasse Öörni 10 years ago
parent
commit
c04aadec58
4 changed files with 5 additions and 3 deletions
  1. 1 0
      Docs/Urho3D.dox
  2. 1 0
      README.md
  3. 2 2
      Source/Urho3D/Scene/Component.cpp
  4. 1 1
      Source/Urho3D/Scene/Node.cpp

+ 1 - 0
Docs/Urho3D.dox

@@ -62,6 +62,7 @@ Urho3D development, contributions and bugfixes by:
 - Lasse Öörni ([email protected], AgentC at GameDev.net)
 - Lasse Öörni ([email protected], AgentC at GameDev.net)
 - Wei Tjong Yao
 - Wei Tjong Yao
 - Aster Jian
 - Aster Jian
+- Vivienne Anthony
 - Colin Barrett
 - Colin Barrett
 - Erik Beran
 - Erik Beran
 - Danny Boisvert
 - Danny Boisvert

+ 1 - 0
README.md

@@ -14,6 +14,7 @@ Urho3D development, contributions and bugfixes by:
 - Lasse Öörni ([email protected], AgentC at GameDev.net)
 - Lasse Öörni ([email protected], AgentC at GameDev.net)
 - Wei Tjong Yao
 - Wei Tjong Yao
 - Aster Jian
 - Aster Jian
+- Vivienne Anthony
 - Colin Barrett
 - Colin Barrett
 - Erik Beran
 - Erik Beran
 - Danny Boisvert
 - Danny Boisvert

+ 2 - 2
Source/Urho3D/Scene/Component.cpp

@@ -68,7 +68,7 @@ bool Component::SaveXML(XMLElement& dest) const
     // Write type and ID
     // Write type and ID
     if (!dest.SetString("type", GetTypeName()))
     if (!dest.SetString("type", GetTypeName()))
         return false;
         return false;
-    if (!dest.SetInt("id", id_))
+    if (!dest.SetUInt("id", id_))
         return false;
         return false;
 
 
     // Write attributes
     // Write attributes
@@ -79,7 +79,7 @@ bool Component::SaveJSON(JSONValue& dest) const
 {
 {
     // Write type and ID
     // Write type and ID
     dest.Set("type", GetTypeName());
     dest.Set("type", GetTypeName());
-    dest.Set("id", (int) id_);
+    dest.Set("id", id_);
 
 
     // Write attributes
     // Write attributes
     return Animatable::SaveJSON(dest);
     return Animatable::SaveJSON(dest);

+ 1 - 1
Source/Urho3D/Scene/Node.cpp

@@ -229,7 +229,7 @@ bool Node::SaveXML(XMLElement& dest) const
 bool Node::SaveJSON(JSONValue& dest) const
 bool Node::SaveJSON(JSONValue& dest) const
 {
 {
     // Write node ID
     // Write node ID
-    dest.Set("id", (unsigned) id_);
+    dest.Set("id", id_);
 
 
     // Write attributes
     // Write attributes
     if (!Animatable::SaveJSON(dest))
     if (!Animatable::SaveJSON(dest))