]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Animation/Skeleton.cpp
Fixes #88 Fixed joints and muscles loading for an existing skeleton object
[lugaru.git] / Source / Animation / Skeleton.cpp
index 91fdbd548441df9e216cb446e30631b03f70485d..a2f919253d342a8844b55a3bbaf6054444abcc1b 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.
 
@@ -717,6 +717,7 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfilename,
     // read num_joints
     funpackf(tfile, "Bi", &num_joints);
 
+    joints.clear();
     joints.resize(num_joints);
 
     // read info for each joint
@@ -728,6 +729,7 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfilename,
     funpackf(tfile, "Bi", &num_muscles);
 
     // allocate memory
+    muscles.clear();
     muscles.resize(num_muscles);
 
     // for each muscle...