mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Factor out slowdown/invincibility conds to function
This factors out the slowdown and invincibility conditionals to a function. This means less copy-pasted code, and it also conveys intent (that we don't want to allow competitive options if we have either of these cheats enabled). This function isn't implemented in the header because then we would have to include Map.h for map.invincibility, and transitive includes are evil. Although, map.invincibility ought to be on Game instead (it was only mapclass due to 2.2-and-previous argument passing), but that's a bunch of variable reshuffling that can be done later.
This commit is contained in:
@@ -6251,7 +6251,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
||||
//ok, secret lab! no notification, but test:
|
||||
if (unlock[8])
|
||||
{
|
||||
option("secret lab", !map.invincibility && slowdown == 30);
|
||||
option("secret lab", !nocompetitive());
|
||||
}
|
||||
option("play modes");
|
||||
if (save_exists())
|
||||
@@ -6285,9 +6285,9 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
||||
menuyoff = 64;
|
||||
break;
|
||||
case Menu::playmodes:
|
||||
option("time trials", !map.invincibility && slowdown == 30);
|
||||
option("time trials", !nocompetitive());
|
||||
option("intermissions", unlock[16]);
|
||||
option("no death mode", unlock[17] && !map.invincibility && slowdown == 30);
|
||||
option("no death mode", unlock[17] && !nocompetitive());
|
||||
option("flip mode", unlock[18]);
|
||||
option("return to play menu");
|
||||
menuyoff = 8;
|
||||
@@ -6810,3 +6810,8 @@ bool Game::incompetitive(void)
|
||||
{
|
||||
return insecretlab || intimetrial || nodeathmode;
|
||||
}
|
||||
|
||||
bool Game::nocompetitive(void)
|
||||
{
|
||||
return slowdown < 30 || map.invincibility;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user