From: sf17k Date: Sat, 7 May 2011 04:57:49 +0000 (-0400) Subject: fix a couple bugs introduced in cleanup X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=d98fef54edac5077cbb07aed8409b28ed20d2421;p=lugaru.git fix a couple bugs introduced in cleanup --- diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index ee3ddea..9314be1 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -2953,55 +2953,6 @@ void Game::doTutorial(){ void Game::doDebugKeys(){ float headprop,bodyprop,armprop,legprop; if(debugmode){ - if(Input::isKeyPressed(SDLK_v)){ - freeze=1-freeze; - if(freeze){ - OPENAL_SetFrequency(OPENAL_ALL, 0.001); - } - } - - if(Input::isKeyPressed(SDLK_BACKQUOTE)){ - console=1-console; - if(console){ - OPENAL_SetFrequency(OPENAL_ALL, 0.001); - } else { - freeze=0; - waiting=false; - } - } - - if(console) - freeze=1; - if(console&&!Input::isKeyDown(SDLK_LMETA)){ - inputText(consoletext[0],&consoleselected,&consolechars[0]); - if(!waiting) { - archiveselected=0; - cmd_dispatch(this, consoletext[0]); - if(consolechars[0]>0){ - - for(int k=14;k>=1;k--){ - for(int j=0;j<255;j++){ - consoletext[k][j]=consoletext[k-1][j]; - } - consolechars[k]=consolechars[k-1]; - } - for(int j=0;j<255;j++){ - consoletext[0][j]=' '; - } - consolechars[0]=0; - consoleselected=0; - } - } - - consoleblinkdelay-=multiplier; - if(consoleblinkdelay<=0){ - consoleblinkdelay=.3; - consoleblink=1-consoleblink; - } - } - - - if(Input::isKeyPressed(SDLK_h)){ player[0].damagetolerance=200000; player[0].damage=0; @@ -6103,6 +6054,13 @@ void Game::Tick(){ displaychars[0]=0; } + if(Input::isKeyPressed(SDLK_v)&&debugmode){ + freeze=1-freeze; + if(freeze){ + OPENAL_SetFrequency(OPENAL_ALL, 0.001); + } + } + if(Input::isKeyPressed(chatkey)&&!console&&!chatting&&debugmode) chatting=1; @@ -6128,6 +6086,48 @@ void Game::Tick(){ if(chatting) keyboardfrozen=1; + if(Input::isKeyPressed(SDLK_BACKQUOTE)&&debugmode){ + console=1-console; + if(console){ + OPENAL_SetFrequency(OPENAL_ALL, 0.001); + } else { + freeze=0; + waiting=false; + } + } + + if(console) + freeze=1; + if(console&&!Input::isKeyDown(SDLK_LMETA)){ + inputText(consoletext[0],&consoleselected,&consolechars[0]); + if(!waiting) { + archiveselected=0; + cmd_dispatch(this, consoletext[0]); + if(consolechars[0]>0){ + + for(int k=14;k>=1;k--){ + for(int j=0;j<255;j++){ + consoletext[k][j]=consoletext[k-1][j]; + } + consolechars[k]=consolechars[k-1]; + } + for(int j=0;j<255;j++){ + consoletext[0][j]=' '; + } + consolechars[0]=0; + consoleselected=0; + } + } + + consoleblinkdelay-=multiplier; + if(consoleblinkdelay<=0){ + consoleblinkdelay=.3; + consoleblink=1-consoleblink; + } + } + + + if(Input::isKeyDown(SDLK_q)&&Input::isKeyDown(SDLK_LMETA)){ tryquit=1; if(mainmenu==3){ @@ -6160,6 +6160,7 @@ void Game::Tick(){ } + //TODO: what is this test? if(!freeze&&!winfreeze&&!(mainmenu&&gameon)&&(gameon||!gamestarted)){