Skip to content

Commit

Permalink
Fixed an issue where options werent being recognised in the config file
Browse files Browse the repository at this point in the history
  • Loading branch information
ash47 committed Dec 30, 2017
1 parent 908de5e commit 9f1a209
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Binary file modified MethodInjector/.vs/MethodInjector/v14/.suo
Binary file not shown.
33 changes: 12 additions & 21 deletions MethodInjector/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,25 @@ static void Main(string[] args)
lineConfig[0] = lineConfig[0].Trim().ToLower();
lineConfig[1] = lineConfig[1].Trim().ToLower();

switch(lineConfig[0])
// Allow a lot of common variants
bool isEnabled = lineConfig[1] == "true" || lineConfig[1] == "1" || lineConfig[1] == "enabled";

switch (lineConfig[0])
{
case "allowModifiedSaveGames":
if (lineConfig[1] == "false")
{
allowModifiedSaveGames = false;
}
case "allowmodifiedsavegames":
allowModifiedSaveGames = isEnabled;
break;

case "enableDevTools":
if (lineConfig[1] == "false")
{
enableDevTools = false;
}
case "enabledevtools":
allowFreeBuildings = isEnabled;
break;

case "enableInstantBuild":
if (lineConfig[1] == "false")
{
enableInstantBuild = false;
}
case "enableinstantbuild":
allowFreeBuildings = isEnabled;
break;

case "allowFreeBuildings":
if (lineConfig[1] == "false")
{
allowFreeBuildings = false;
}
case "allowfreebuildings":
allowFreeBuildings = isEnabled;
break;

default:
Expand Down

0 comments on commit 9f1a209

Please sign in to comment.