Skip to content

Commit

Permalink
Prevent handicap and dmgfrags changing in LGC mode
Browse files Browse the repository at this point in the history
  • Loading branch information
burevestnik12 committed Dec 2, 2024
1 parent f8d7cb1 commit 2ac3890
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -5092,6 +5092,15 @@ void hdptoggle(void)

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 @@ void ToggleLGC(void)
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 @@ void dmgfrags(void)
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

0 comments on commit 2ac3890

Please sign in to comment.