Skip to content
Open
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions src/game/cheats.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ void cheatActivate(s32 cheat_id)
setCurrentPlayerNum(prevplayernum);
break;
case CHEAT_ALLGUNS:
#ifndef PLATFORM_N64
Copy link
Copy Markdown
Author

@blaiz blaiz May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to make this work in Combat Simulator? I think so, let the user decide. But we could easily turn off that part of the cheat by adding back if (g_Vars.normmplayerisrunning == false) {

// Give all guns to all players
prevplayernum = g_Vars.currentplayernum;

for (playernum = 0; playernum < PLAYERCOUNT(); playernum++) {
setCurrentPlayerNum(playernum);
invSetAllGuns(true);
}

setCurrentPlayerNum(prevplayernum);
#else
// Give all guns if only one player playing
if (PLAYERCOUNT() == 1 && g_Vars.normmplayerisrunning == false) {
prevplayernum = g_Vars.currentplayernum;
Expand All @@ -176,6 +187,7 @@ void cheatActivate(s32 cheat_id)

setCurrentPlayerNum(prevplayernum);
}
#endif
break;
}

Expand Down Expand Up @@ -203,6 +215,16 @@ void cheatDeactivate(s32 cheat_id)
setCurrentPlayerNum(prevplayernum);
break;
case CHEAT_ALLGUNS:
#ifndef PLATFORM_N64
prevplayernum = g_Vars.currentplayernum;

for (playernum = 0; playernum < PLAYERCOUNT(); playernum++) {
setCurrentPlayerNum(playernum);
invSetAllGuns(false);
}

setCurrentPlayerNum(prevplayernum);
#else
if (PLAYERCOUNT() == 1 && g_Vars.normmplayerisrunning == false) {
prevplayernum = g_Vars.currentplayernum;

Expand All @@ -213,6 +235,7 @@ void cheatDeactivate(s32 cheat_id)

setCurrentPlayerNum(prevplayernum);
}
#endif
break;
}

Expand Down
4 changes: 4 additions & 0 deletions src/game/invreset.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ void invReset(void)
{
s32 i;

#ifndef PLATFORM_N64
g_Vars.currentplayer->equipallguns = cheatIsActive(CHEAT_ALLGUNS);
#else
if (PLAYERCOUNT() == 1 && g_Vars.normmplayerisrunning == false) {
g_Vars.currentplayer->equipallguns = cheatIsActive(CHEAT_ALLGUNS);
} else {
g_Vars.currentplayer->equipallguns = false;
}
#endif

for (i = 0; i != ARRAYCOUNT(g_Vars.currentplayer->gunheldarr); i++) {
g_Vars.currentplayer->gunheldarr[i].totaltime240_60 = -1;
Expand Down