Skip to content

Commit

Permalink
Handle invulnerability before buddha mode when kill player entered
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 5, 2023
1 parent 1fa13f3 commit 4e7daa5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Minor changes have been made to text that is output to the console.
* The `if` CCMD now works with boolean CVARs.
* Blood splats are now rendered in the top half of the player’s view if not completely obscured by the map’s geometry.
* If the player enters `kill player` in the console while buddha mode is enabled, their health is now reduced to 1%.
* `SIGIL.WAD` is no longer autoloaded if a PWAD is loaded that contains an `E1M1` lump.
* If `SIGIL.WAD` or `NERVE.WAD` are in the autoload folder, they are now loaded before any other PWADs.
* Minor improvements have been made to the highlight effect in the menu.
Expand Down
22 changes: 11 additions & 11 deletions src/c_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -3329,17 +3329,6 @@ static void kill_cmd_func2(char *cmd, char *parms)
return;
}

if (viewplayer->cheats & CF_BUDDHA)
{
if (M_StringCompare(playername, playername_default))
C_Warning(0, "You can't kill yourself in buddha mode!");
else
C_Warning(0, "%s can't kill %s in buddha mode!", playername, preferredpronoun(reflexive));

player_cvars_func2(stringize(health), "1");
return;
}

if (viewplayer->powers[pw_invulnerability])
{
if (M_StringCompare(playername, playername_default))
Expand All @@ -3358,6 +3347,17 @@ static void kill_cmd_func2(char *cmd, char *parms)
return;
}

if (viewplayer->cheats & CF_BUDDHA)
{
if (M_StringCompare(playername, playername_default))
C_Warning(0, "You can't kill yourself in buddha mode!");
else
C_Warning(0, "%s can't kill %s in buddha mode!", playername, preferredpronoun(reflexive));

player_cvars_func2(stringize(health), "1");
return;
}

massacre = true;

viewplayer->damagecount = MIN(viewplayer->health, 100);
Expand Down

0 comments on commit 4e7daa5

Please sign in to comment.