--- deliantra/server/common/anim.C 2006/09/03 00:18:39 1.4 +++ deliantra/server/common/anim.C 2006/09/03 08:05:39 1.6 @@ -1,6 +1,6 @@ /* * static char *rcsid_anim_c = - * "$Id: anim.C,v 1.4 2006/09/03 00:18:39 root Exp $"; + * "$Id: anim.C,v 1.6 2006/09/03 08:05:39 root Exp $"; */ /* @@ -60,11 +60,17 @@ * Put # at start so it will be first in alphabetical * order. */ - animations[0].name = "###none"; - animations[0].num_animations=1; - animations[0].faces = (Fontindex *) malloc(sizeof(Fontindex)); - animations[0].faces[0]=0; - animations[0].facings=0; + { + Animations anim0; + + anim0.name = "###none"; + anim0.num_animations=1; + anim0.faces = (Fontindex *) malloc(sizeof(Fontindex)); + anim0.faces[0]=0; + anim0.facings=0; + + animations.push_back (anim0); + } sprintf(buf,"%s/animations", settings.datadir); LOG(llevDebug,"Reading animations from %s...", buf); @@ -83,10 +89,11 @@ } num_animations++; - animations.resize (num_animations + 1); - animations[num_animations].name = buf + 5; - animations[num_animations].num = num_animations; /* for bsearch */ - animations[num_animations].facings = 1; + Animations anim; + anim.name = buf + 5; + anim.num = num_animations; /* for bsearch */ + anim.facings = 1; + animations.push_back (anim); } else if (!strncmp(buf,"mina",4)) { animations[num_animations].faces = (Fontindex *) malloc(sizeof(Fontindex)*num_frames); @@ -129,7 +136,7 @@ search.name = name; - match = (Animations*)bsearch(&search, animations, (num_animations+1), + match = (Animations*)bsearch(&search, &animations [0], (num_animations+1), sizeof(Animations), (int (*)(const void*, const void*))anim_compare);