mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Don't manually write out INBOUNDS_VEC() checks
This is because if they are manually written out, they are more likely to contain mistakes. In fact, after further review, there are several functions with incorrect manually-written bounds checks: * entityclass::entitycollide() * entityclass::removeentity() * entityclass::removeblock() * entityclass::copylinecross() * entityclass::revertlinecross() All of those functions forgot to do 'greater than or equal to' instead of 'greater than' when comparing against the size of the vector. So they were erroneous. But they are now fixed.
This commit is contained in:
@@ -54,7 +54,7 @@ void menurender()
|
||||
graphics.Print( -1, 100, "ERROR: No levels found.", tr, tg, tb, true);
|
||||
}
|
||||
int tmp=game.currentmenuoption+(game.levelpage*8);
|
||||
if(tmp>=0 && tmp < (int) ed.ListOfMetaData.size()){ // FIXME: size_t/int! -flibit
|
||||
if(INBOUNDS_VEC(tmp, ed.ListOfMetaData)){
|
||||
//Don't show next/previous page or return to menu options here!
|
||||
if(game.menuoptions.size() - game.currentmenuoption<=3){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user