]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Animation/Joint.cpp
Fixes #88 Fixed joints and muscles loading for an existing skeleton object
[lugaru.git] / Source / Animation / Joint.cpp
index 4d3dd7c3e98d110bf0c1070ebe412148bd1e3156..87d0a33678821f28b40f110ad2548b2eeb516fb6 100644 (file)
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 2003, 2010 - Wolfire Games
-Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
+Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file)
 
 This file is part of Lugaru.
 
@@ -18,23 +18,24 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "Animation/Joint.h"
-#include "binio.h"
-
-Joint::Joint() :
-    blurred(0),
-    length(0),
-    mass(0),
-    lower(false),
-    hasparent(false),
-    locked(false),
-    modelnum(0),
-    visible(false),
-    parent(nullptr),
-    sametwist(false),
-    label(head),
-    hasgun(0),
-    delay(0)
+#include "Animation/Joint.hpp"
+
+#include "Utils/binio.h"
+
+Joint::Joint()
+    : blurred(0)
+    , length(0)
+    , mass(0)
+    , lower(false)
+    , hasparent(false)
+    , locked(false)
+    , modelnum(0)
+    , visible(false)
+    , parent(nullptr)
+    , sametwist(false)
+    , label(head)
+    , hasgun(0)
+    , delay(0)
 {
 }
 
@@ -51,6 +52,8 @@ void Joint::load(FILE* tfile, std::vector<Joint>& joints)
     funpackf(tfile, "Bi", &parentID);
     if (hasparent) {
         parent = &joints[parentID];
+    } else {
+        parent = nullptr;
     }
     velocity = 0;
     oldposition = position;