fix -dogs default value, add error message (#909)

* fix -dogs default value, add error message

* don't throw an error if `default_dogs` are set
This commit is contained in:
Roman Fomin 2023-02-16 14:39:45 +07:00 committed by GitHub
parent 8cd1f51f3a
commit e569f3daad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -2802,7 +2802,7 @@ static int G_GetHelpers(void)
// //
j = M_CheckParm ("-dogs"); j = M_CheckParm ("-dogs");
return j ? j+1 < myargc ? M_ParmArgToInt(j) : 1 : default_dogs; return j ? (j+1 < myargc && myargv[j+1][0] != '-') ? M_ParmArgToInt(j) : 1 : default_dogs;
} }
// [FG] support named complevels on the command line, e.g. "-complevel boom", // [FG] support named complevels on the command line, e.g. "-complevel boom",
@ -3113,6 +3113,9 @@ void G_ReloadDefaults(boolean keep_demover)
if (beta_emulation && demo_version != 203) if (beta_emulation && demo_version != 203)
I_Error("G_ReloadDefaults: Beta emulation requires complevel MBF."); I_Error("G_ReloadDefaults: Beta emulation requires complevel MBF.");
if ((M_CheckParm("-dog") || M_CheckParm("-dogs")) && demo_version < 203)
I_Error("G_ReloadDefaults: Helper dogs require complevel MBF or MBF21.");
if (demo_version < 203) if (demo_version < 203)
{ {
monster_infighting = 1; monster_infighting = 1;

View File

@ -204,6 +204,11 @@ void M_CheckCommandLine(void)
{ {
++p; ++p;
} }
// -dogs has default value
else if (!strcasecmp(myargv[p], "-dogs"))
{
++p;
}
// -statdump and -dehout allow "-" parameter // -statdump and -dehout allow "-" parameter
else if ((!strcasecmp(myargv[p], "-statdump") || else if ((!strcasecmp(myargv[p], "-statdump") ||
!strcasecmp(myargv[p], "-dehout")) && !strcasecmp(myargv[p], "-dehout")) &&