Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent handicap and dmgfrags changing in LGC mode #379

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1881,12 +1881,12 @@

if (floor(k_captains) == 1)
{
G_sprint(self, 2, "\2201\221 %s present\n", redtext("captain"));

Check warning on line 1884 in src/commands.c

View workflow job for this annotation

GitHub Actions / verify-msvc

decimal digit terminates octal escape sequence [D:\a\ktx\ktx\builddir\qwprogs.vcxproj]
}

if (floor(k_coaches) == 1)
{
G_sprint(self, 2, "\2201\221 %s present\n", redtext("coach"));

Check warning on line 1889 in src/commands.c

View workflow job for this annotation

GitHub Actions / verify-msvc

decimal digit terminates octal escape sequence [D:\a\ktx\ktx\builddir\qwprogs.vcxproj]
}

if (match_in_progress == 2)
Expand Down Expand Up @@ -5092,6 +5092,15 @@

void handicap(void)
{
qbool k_lgc = cvar(LGCMODE_VARIABLE) != 0;

if (k_lgc)
{
G_sprint(self, 2, "Handicap is not allowed in LGC mode\n");

return;
}

char arg_2[1024];

if (trap_CmdArgc() != 2)
Expand Down Expand Up @@ -7623,6 +7632,15 @@
cvar_set("k_instagib", "0");
}

// disable dmgfrags
if (cvar("k_dmgfrags"))
{
cvar_set("k_dmgfrags", "0");
}

// turn off handicap
SetHandicap(self, 100);

cvar_set(LGCMODE_VARIABLE, k_lgc ? "1" : "0");

cvar_toggle_msg(self, LGCMODE_VARIABLE, redtext("LGC mode"));
Expand Down Expand Up @@ -7861,6 +7879,15 @@
return;
}

qbool k_lgc = cvar(LGCMODE_VARIABLE) != 0;

if (k_lgc)
{
G_sprint(self, 2, "Dmgfrags is not allowed in LGC mode\n");

return;
}

cvar_toggle_msg(self, "k_dmgfrags", redtext("damage frags"));
}

Expand Down
Loading