Skip to content

Commit

Permalink
make cheat restrictions consistent for menu and player input (#1071)
Browse files Browse the repository at this point in the history
* disable cheats in strictmode
  • Loading branch information
rfomin authored May 23, 2023
1 parent 6167d92 commit f6e3c01
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/m_cheat.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ struct cheat_s cheat[] = {
{"idbeholdr", "Radiation Suit", not_net | not_demo,
{cheat_pw}, pw_ironfeet },

{"idbeholda", "Auto-map", not_net | not_demo,
{"idbeholda", "Auto-map", not_dm,
{cheat_pw}, pw_allmap },

{"idbeholdl", "Lite-Amp Goggles", not_net | not_demo,
{"idbeholdl", "Lite-Amp Goggles", not_dm,
{cheat_pw}, pw_infrared },

{"idbehold", "BEHOLD menu", not_net | not_demo,
Expand Down Expand Up @@ -1258,10 +1258,10 @@ static const struct {
{ input_idbeholds, not_net|not_demo, {cheat_pw}, pw_strength },
{ input_idbeholdi, not_net|not_demo, {cheat_pw}, pw_invisibility },
{ input_idbeholdr, not_net|not_demo, {cheat_pw}, pw_ironfeet },
{ input_idbeholda, always, {cheat_pw}, pw_allmap },
{ input_idbeholdl, always, {cheat_pw}, pw_infrared },
{ input_idbeholda, not_dm, {cheat_pw}, pw_allmap },
{ input_idbeholdl, not_dm, {cheat_pw}, pw_infrared },
{ input_idrate, always, {cheat_rate}, 0 },
{ input_iddt, always, {cheat_ddt}, 0 },
{ input_iddt, not_dm, {cheat_ddt}, 0 },
{ input_notarget, not_net|not_demo, {cheat_notarget}, 0 },
{ input_freeze, not_net|not_demo, {cheat_freeze}, 0 },
{ input_avj, not_net|not_demo, {cheat_avj}, 0 },
Expand All @@ -1271,6 +1271,9 @@ boolean M_CheatResponder(event_t *ev)
{
int i;

if (strictmode)
return false;

if (ev->type == ev_keydown && M_FindCheats(ev->data1))
return true;

Expand Down

0 comments on commit f6e3c01

Please sign in to comment.