[Tuxracer-checkins] CVS: tuxracer/src reset.c,1.7,1.8
Status: Beta
Brought to you by:
jfpatry
From: Jasmin P. <jf...@us...> - 2000-10-01 21:31:59
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv26544 Modified Files: reset.c Log Message: Fixed bug in reset code in which array would be indexed at -1 if no reset points existed behind player. Index: reset.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/reset.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** reset.c 2000/09/25 21:21:18 1.7 --- reset.c 2000/10/01 21:31:50 1.8 *************** *** 126,131 **** for ( i = first_reset; i <= last_reset; i++) { if (item_locs[i].ray.pt.z > plyr->pos.z ) { ! if (best_loc == -1 || item_locs[i].ray.pt.z < ! item_locs[best_loc].ray.pt.z){ best_loc = i; } --- 126,132 ---- for ( i = first_reset; i <= last_reset; i++) { if (item_locs[i].ray.pt.z > plyr->pos.z ) { ! if (best_loc == -1 || ! item_locs[i].ray.pt.z < item_locs[best_loc].ray.pt.z) ! { best_loc = i; } *************** *** 133,137 **** } ! if ( item_locs[best_loc].ray.pt.z <= plyr->pos.z ) { get_course_dimensions( &course_width, &course_length ); plyr->pos.x = course_width/2.0; --- 134,142 ---- } ! if ( best_loc == -1 ) { ! get_course_dimensions( &course_width, &course_length ); ! plyr->pos.x = course_width/2.0; ! plyr->pos.z = min(plyr->pos.z + 10, -1.0); ! } else if ( item_locs[best_loc].ray.pt.z <= plyr->pos.z ) { get_course_dimensions( &course_width, &course_length ); plyr->pos.x = course_width/2.0; |