Skip to content

Commit

Permalink
Fix obituary when player explodes barrel and playername CVAR empty
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 18, 2024
1 parent aa94898 commit 2d6dea1
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/p_inter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,12 +1776,21 @@ static void P_WriteObituary(mobj_t *target, mobj_t *inflicter, mobj_t *source, c
temp = sentencecase(targetname);

if (inflicter->inflicter == MT_PLAYER)
C_PlayerMessage("%s was %s by %s %s %s exploded.",
temp,
(gibbed ? s_GIBBED : s_KILLED),
(inflictername && isvowel(inflictername[0]) ? "an" : "a"),
(inflictername ? inflictername : "barrel"),
playername);
{
if (M_StringCompare(playername, playername_default))
C_PlayerMessage("%s was %s by %s %s you exploded.",
temp,
(gibbed ? s_GIBBED : s_KILLED),
(inflictername && isvowel(inflictername[0]) ? "an" : "a"),
(inflictername ? inflictername : "barrel"));
else
C_PlayerMessage("%s was %s by %s %s %s exploded.",
temp,
(gibbed ? s_GIBBED : s_KILLED),
(inflictername &&isvowel(inflictername[0]) ? "an" : "a"),
(inflictername ? inflictername : "barrel"),
playername);
}
else if (source == target)
C_PlayerMessage("%s was %s by %s %s they exploded.",
temp,
Expand Down

0 comments on commit 2d6dea1

Please sign in to comment.