Browse Source

Fix warnings in interactions() and setup_level_bossrush()

Add break at the end of switch cases in setup_evel_bossrush().
Change int to size_t in interactions(), since it is compared to the size
of the walls vector.
Matteo Zeccoli Marazzini 3 years ago
parent
commit
f6caea0e95
1 changed files with 5 additions and 1 deletions
  1. 5 1
      functions.cpp

+ 5 - 1
functions.cpp

@@ -1080,7 +1080,7 @@ void interactions(player& player1,b_list& bullets,b_list& bombs,e_list& enemies,
  		++itp;
 	}
         	
-	for(int i=0;i<walls.size();i++)
+	for(size_t i=0;i<walls.size();i++)
 	  	for(int j=0;j<walls[i].width;j++)
 	  		for(int k=0;k<walls[i].height;k++)
 	  		{
@@ -1448,24 +1448,28 @@ void setup_level_bossrush(int level, double& shootr, double& poweruprate, int& w
 			shootr = 0.006;
 			refresh_t = (int)(0.09*1E3);
 			poweruprate = 0.066;
+			break;
 		}
 		case 2:
 		{
 			shootr = 0.009;
 			refresh_t = (int)(0.085*1E3);
 			poweruprate = 0.05;
+			break;
 		}
 		case 3:
 		{
 			shootr = 0.015;
 			refresh_t = (int)(0.08*1E3);
 			poweruprate = 0.044;
+			break;
 		}
 		case 4:
 		{
 			shootr = 0.020;
 			refresh_t = (int)(0.07*1E3);
 			poweruprate = 0.04;
+			break;
 		}
 	}
 	walls_num = 3;