1
0
Fork 0

Avoid a segfault when a named object is not found for an animation.

Ensure that global animations are applied to the model.
This commit is contained in:
david 2002-06-19 02:58:06 +00:00
parent dc132d80b1
commit 9569c43126

View file

@ -229,6 +229,8 @@ FG3DModel::init (const string &path)
animation_nodes[i]->getChildren("object-name");
if (name_nodes.size() < 1) {
Animation * animation = make_animation(0, animation_nodes[i]);
if (animation != 0)
_animations.push_back(animation);
} else {
for (unsigned int j = 0; j < name_nodes.size(); j++) {
Animation * animation =
@ -309,7 +311,8 @@ FG3DModel::make_animation (const char * object_name,
object = _model;
}
animation->init(object, node);
if (animation != 0)
animation->init(object, node);
return animation;
}