X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=05bb4ce08dd6c9f5430d30e2b019d5c6fcb7700d;hb=bbf8873b80baf3cb468ac12b3f62b0938320fef1;hp=326d9fd1c07b55b94356db20c5ba085576e8f761;hpb=5c961692f7f10024432ff06be1ef569638e29bd4;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 326d9fd..05bb4ce 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif +#include #include #include "Game.h" #include "openal_wrapper.h" @@ -495,7 +496,7 @@ static void ch_size(Game *game, const char *args) static int find_closest() { int closest = 0; - float closestdist = 1.0/0.0; + float closestdist = std::numeric_limits::max(); for (int i = 1; i < numplayers; i++) { float distance; @@ -2176,8 +2177,7 @@ void Game::MenuTick(){ mainmenu=1; } } - } - if(mainmenu==3){ + }else if(mainmenu==3){ if(Input::MouseClicked()){ if(selected!=-1) @@ -2296,8 +2296,7 @@ void Game::MenuTick(){ break; } } - } - if(mainmenu==4){ + }else if(mainmenu==4){ if(Input::MouseClicked()&&selected!=-1&&!waiting){ fireSound(); if(selected<9&&keyselect==-1) @@ -2317,9 +2316,7 @@ void Game::MenuTick(){ if(newscreenheight<0)newscreenheight=screenheight; } } - } - - if(mainmenu==5){ + }else if(mainmenu==5){ if(endgame==2){ accountactive->endGame(); @@ -2383,8 +2380,7 @@ void Game::MenuTick(){ break; } } - } - else if(mainmenu==9){ + }else if(mainmenu==9){ if(Input::MouseClicked()&&selected=0&&selected<=accountactive->getProgress()){ fireSound(); flash(); @@ -2410,17 +2406,14 @@ void Game::MenuTick(){ flash(); mainmenu=5; } - } - if(mainmenu==10){ + }else if(mainmenu==10){ endgame=2; if(Input::MouseClicked()&&selected==3){ fireSound(); flash(); mainmenu=5; } - } - - if(mainmenu==6){ + }else if(mainmenu==6){ if(Input::MouseClicked()) { if(selected>-1){ fireSound(); @@ -2434,8 +2427,7 @@ void Game::MenuTick(){ } } } - } - if(mainmenu==7){ + }else if(mainmenu==7){ if(Input::MouseClicked()) { if(selected!=-1){ fireSound(); @@ -2459,8 +2451,7 @@ void Game::MenuTick(){ } } } - } - if(mainmenu==8){ + }else if(mainmenu==8){ if(Input::MouseClicked()&&selected>-1){ fireSound(); flash(); @@ -2468,8 +2459,7 @@ void Game::MenuTick(){ accountactive->setDifficulty(selected); mainmenu=5; } - } - if (mainmenu==18) { + }else if(mainmenu==18){ if(Input::MouseClicked()&&selected==0) { newstereomode = (StereoMode)(newstereomode + 1); while(!CanInitStereo(newstereomode)) {