From: Daniel H. <hel...@us...> - 2005-01-31 11:24:49
|
Update of /cvsroot/vegastrike/vegastrike/src/gfx/nav In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8722/gfx/nav Modified Files: navpath.cpp Log Message: added some mem bounds on the path searching (fixed silly noncheck) Index: navpath.cpp =================================================================== RCS file: /cvsroot/vegastrike/vegastrike/src/gfx/nav/navpath.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** navpath.cpp 31 Jan 2005 11:22:41 -0000 1.7 --- navpath.cpp 31 Jan 2005 11:24:38 -0000 1.8 *************** *** 378,388 **** path.push_back(index); index=prev[index]; } path.push_back(destIndex); - if (path.size()>=max_size) {//this prevents some odd "out of memory" crashes we were getting where there might have been a loop in the path somehow - path.clear(); - found=false; - return false; - } } } --- 378,388 ---- path.push_back(index); index=prev[index]; + if (path.size()>=max_size) {//this prevents some odd "out of memory" crashes we were getting where there might have been a loop in the path somehow + path.clear(); + found=false; + return false; + } } path.push_back(destIndex); } } *************** *** 437,441 **** index=prev[index]; path.push_front(index); ! if (path.size()>max_size) {//this prevents some odd "out of memory" crashes we were getting where there might have been a loop in the path somehow path.clear(); found=false; --- 437,441 ---- index=prev[index]; path.push_front(index); ! if (path.size()>=max_size) {//this prevents some odd "out of memory" crashes we were getting where there might have been a loop in the path somehow path.clear(); found=false; |