From d98fef54edac5077cbb07aed8409b28ed20d2421 Mon Sep 17 00:00:00 2001 From: sf17k Date: Sat, 7 May 2011 00:57:49 -0400 Subject: [PATCH] fix a couple bugs introduced in cleanup --- Source/GameTick.cpp | 99 +++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 49 deletions(-) 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)){ -- 2.39.5