From: <js...@us...> - 2008-05-24 03:45:16
|
Update of /cvsroot/exult/exult/shapes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv12174/shapes Modified Files: miscinf.cc Log Message: Fixed flying-carpet bugs Index: miscinf.cc =================================================================== RCS file: /cvsroot/exult/exult/shapes/miscinf.cc,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- miscinf.cc 24 Oct 2007 01:43:12 -0000 1.17 +++ miscinf.cc 24 May 2008 03:45:12 -0000 1.18 @@ -1111,7 +1111,14 @@ return &inf; } ShapeID shp(shapenum, 0); - Animation_info inf = {FA_LOOPING, 0, shp.get_num_frames(), 0, -1, 1, 1}; + int nframes = shp.get_num_frames(); + if (init_frame >= nframes) + { // Too big? Maybe rotated. + init_frame &= ~(1<<5); + if (init_frame >= nframes) + init_frame = 0; // Avoid infinite recursion. + } + Animation_info inf = {FA_LOOPING, 0, nframes, 0, -1, 1, 1}; animation_cycle_table->insert(pair<int, Animation_info>(shapenum, inf)); // Return the one in the table. return get_animation_cycle_info(shapenum, init_frame); |