From caa4f0f5c98b73b1b7e33ca2cb0f381a4d2dc963 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 22 Jun 2020 17:37:53 -0700 Subject: [PATCH] Prevent turning on invincibility/slowdown in in-game options menu Would've been the easiest exploit ever! But I gotta patch it. --- desktop_version/src/Game.cpp | 4 ++-- desktop_version/src/Input.cpp | 32 ++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 9b1a6694..b717e264 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -7147,8 +7147,8 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) option("animated backgrounds"); option("screen effects"); option("text outline"); - option("invincibility"); - option("slowdown"); + option("invincibility", !ingame_titlemode || !inspecial()); + option("slowdown", !ingame_titlemode || !inspecial()); option("load screen"); option("room name bg"); option("return"); diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index abea325a..a69e5829 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -493,22 +493,38 @@ void menuactionpress() break; case 3: //invincibility - if (!map.invincibility) + if (!game.ingame_titlemode || !game.inspecial()) { - game.createmenu(Menu::setinvincibility); - map.nexttowercolour(); + if (!map.invincibility) + { + game.createmenu(Menu::setinvincibility); + map.nexttowercolour(); + } + else + { + map.invincibility = !map.invincibility; + } + music.playef(11); } else { - map.invincibility = !map.invincibility; + music.playef(2); + map.invincibility = false; } - music.playef(11); break; case 4: //change game speed - game.createmenu(Menu::setslowdown); - map.nexttowercolour(); - music.playef(11); + if (!game.inspecial()) + { + game.createmenu(Menu::setslowdown); + map.nexttowercolour(); + music.playef(11); + } + else + { + music.playef(2); + game.gameframerate = 34; + } break; case 5: // toggle fake load screen