Removed support for the old cheats.

It was broken, and I don't think it's worth fixing.
This commit is contained in:
onpon4 2015-02-27 13:35:47 -05:00
parent eb8d68448e
commit e6f8b3a65f
4 changed files with 3 additions and 47 deletions

View File

@ -62,7 +62,8 @@ int main(int argc, char *argv[])
cheatCount = 2; cheatCount = 2;
if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2)) if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2))
cheatCount = 3; cheatCount = 3;
if ((strcmp(argv[i], "better") == 0) && (cheatCount == 3)) if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3)) ||
(strcmp(argv[i], "humansdoitbetter") == 0))
{printf("Humans do it better! Cheats enabled.\n"); engine.cheat = true;} {printf("Humans do it better! Cheats enabled.\n"); engine.cheat = true;}
} }
@ -72,7 +73,7 @@ int main(int argc, char *argv[])
initSystem(); // Opens video mode and sound initSystem(); // Opens video mode and sound
loadFont(); loadFont();
if (cheatAttempt) if (cheatAttempt && !engine.cheat)
{ {
clearScreen(black); clearScreen(black);
drawString("That doesn't work anymore", -1, 285, FONT_WHITE); drawString("That doesn't work anymore", -1, 285, FONT_WHITE);

View File

@ -44,43 +44,3 @@ bool checkPauseRequest()
return false; return false;
} }
static void compareLastKeyInputs()
{
if (strstr(lastKeyEvents, "humansdoitbetter") != NULL)
{engine.cheat = true; memset(lastKeyEvents, ' ', 25);}
if (strstr(lastKeyEvents, "credits") != NULL)
{engine.cheatCredits = true; memset(lastKeyEvents, ' ', 25);}
}
void addKeyEvent(const char *keyName)
{
if (strlen(keyName) > 1)
return;
int index = -1;
for (int i = 0 ; i < 25 ; i++)
{
if (lastKeyEvents[i] == ' ')
{
index = i;
break;
}
}
if (index == -1)
{
for (int i = 0 ; i < 25 ; i++)
{
lastKeyEvents[i] = lastKeyEvents[i + 1];
}
index = 24;
}
lastKeyEvents[index] = keyName[0];
compareLastKeyInputs();
}

View File

@ -16,4 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
extern bool checkPauseRequest(); extern bool checkPauseRequest();
extern void addKeyEvent(const char *keyName);

View File

@ -387,10 +387,6 @@ void getPlayerInput()
break; break;
case SDL_KEYDOWN: case SDL_KEYDOWN:
//TODO: reenable somehow?
//if (engine.gameSection == SECTION_TITLE)
// addKeyEvent(SDL_GetKeyName(engine.event.key.keysym.sym));
engine.keyState[mapkey(engine.event.key.keysym.sym)] = 1; engine.keyState[mapkey(engine.event.key.keysym.sym)] = 1;
if (engine.gameSection != SECTION_GAME) if (engine.gameSection != SECTION_GAME)