Skip to content

Commit 7cd9727

Browse files
authored
Merge pull request CDarrow#60 from dxx-redux/sirius/tidy-kill-feed
Suppress kill/death messages w/ observer death log
2 parents 0262d0a + 5e99804 commit 7cd9727

6 files changed

Lines changed: 32 additions & 20 deletions

File tree

d1/main/hud.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ static int is_worth_showing(int class_flag)
120120

121121
if (PlayerCfg.MultiMessages && (Game_mode & GM_MULTI) && !(class_flag & HM_MULTI))
122122
return 0;
123+
124+
// Don't show kill feed messages if the observer death log is active; they're redundant
125+
if (is_observer() && PlayerCfg.ObsShowKillFeed && (class_flag & HM_KILLFEED))
126+
return 0;
127+
123128
return 1;
124129
}
125130

d1/main/hudmsg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define HM_MULTI 2 // a message related to multiplayer (game and player messages)
1313
#define HM_REDUNDANT 4 // "you already have..."-type messages. stuff a player is able to supress
1414
#define HM_MAYDUPL 8 // messages that might appear once per frame. for these we want to check all messages we have in queue and supress it if so
15+
#define HM_KILLFEED 0x10 // messages describing multiplayer kills/deaths
1516

1617
extern int HUD_toolong;
1718
extern void HUD_clear_messages();

d1/main/multi.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,13 +1137,13 @@ void multi_compute_kill(int killer, int killed)
11371137

11381138
if (killed_pnum == Player_num)
11391139
{
1140-
HUD_init_message(HM_MULTI, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_NONPLAY);
1140+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_NONPLAY);
11411141
multi_add_lifetime_killed ();
11421142

11431143
robo_anarchy_suicide_penalty();
11441144
}
11451145
else
1146-
HUD_init_message(HM_MULTI, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_NONPLAY );
1146+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_NONPLAY );
11471147

11481148
add_observatory_stat(killed_pnum, OBSEV_DEATH | OBSEV_REACTOR);
11491149

@@ -1154,13 +1154,13 @@ void multi_compute_kill(int killer, int killed)
11541154
{
11551155
if (killed_pnum == Player_num)
11561156
{
1157-
HUD_init_message(HM_MULTI, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_ROBOT);
1157+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_ROBOT);
11581158
multi_add_lifetime_killed();
11591159

11601160
robo_anarchy_suicide_penalty();
11611161
}
11621162
else
1163-
HUD_init_message(HM_MULTI, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_ROBOT );
1163+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_ROBOT );
11641164
Players[killed_pnum].net_killed_total++;
11651165

11661166
add_observatory_stat(killed_pnum, OBSEV_DEATH | OBSEV_ROBOT);
@@ -1200,11 +1200,11 @@ void multi_compute_kill(int killer, int killed)
12001200
kill_matrix[killed_pnum][killed_pnum] += 1; // # of suicides
12011201
if (killer_pnum == Player_num)
12021202
{
1203-
HUD_init_message(HM_MULTI, "%s %s %s!", TXT_YOU, TXT_KILLED, TXT_YOURSELF );
1203+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", TXT_YOU, TXT_KILLED, TXT_YOURSELF );
12041204
multi_add_lifetime_killed();
12051205
}
12061206
else
1207-
HUD_init_message(HM_MULTI, "%s %s", killed_name, TXT_SUICIDE);
1207+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s", killed_name, TXT_SUICIDE);
12081208

12091209
/* Bounty mode needs some lovin' */
12101210
if( Game_mode & GM_BOUNTY && killed_pnum == Bounty_target && multi_i_am_master() )
@@ -1278,7 +1278,7 @@ void multi_compute_kill(int killer, int killed)
12781278
}
12791279

12801280
if (killer_pnum == Player_num) {
1281-
HUD_init_message(HM_MULTI, "%s %s %s!", TXT_YOU, TXT_KILLED, killed_name);
1281+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", TXT_YOU, TXT_KILLED, killed_name);
12821282
multi_add_lifetime_kills();
12831283
if ((Game_mode & GM_MULTI_COOP) && (Players[Player_num].score >= 1000))
12841284
add_points_to_score(-1000);
@@ -1288,11 +1288,11 @@ void multi_compute_kill(int killer, int killed)
12881288
}
12891289
else if (killed_pnum == Player_num)
12901290
{
1291-
HUD_init_message(HM_MULTI, "%s %s %s!", killer_name, TXT_KILLED, TXT_YOU);
1291+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", killer_name, TXT_KILLED, TXT_YOU);
12921292
multi_add_lifetime_killed();
12931293
}
12941294
else
1295-
HUD_init_message(HM_MULTI, "%s %s %s!", killer_name, TXT_KILLED, killed_name);
1295+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", killer_name, TXT_KILLED, killed_name);
12961296

12971297
add_observatory_stat(killed_pnum, OBSEV_DEATH | OBSEV_PLAYER);
12981298
add_observatory_stat(killer_pnum, OBSEV_KILL | OBSEV_PLAYER);

d2/main/hud.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ static int is_worth_showing(int class_flag)
124124

125125
if (PlayerCfg.MultiMessages && (Game_mode & GM_MULTI) && !(class_flag & HM_MULTI))
126126
return 0;
127+
128+
// Don't show kill feed messages if the observer death log is active; they're redundant
129+
if (is_observer() && PlayerCfg.ObsShowKillFeed && (class_flag & HM_KILLFEED))
130+
return 0;
131+
127132
return 1;
128133
}
129134

d2/main/hudmsg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define HM_MULTI 2 // a message related to multiplayer (game and player messages)
1313
#define HM_REDUNDANT 4 // "you already have..."-type messages. stuff a player is able to supress
1414
#define HM_MAYDUPL 8 // messages that might appear once per frame. for these we want to check all messages we have in queue and supress it if so
15+
#define HM_KILLFEED 0x10 // messages describing multiplayer kills/deaths
1516

1617
extern int HUD_toolong;
1718
extern void HUD_clear_messages();

d2/main/multi.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,13 +1154,13 @@ void multi_compute_kill(int killer, int killed)
11541154

11551155
if (killed_pnum == Player_num)
11561156
{
1157-
HUD_init_message(HM_MULTI, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_NONPLAY);
1157+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_NONPLAY);
11581158
multi_add_lifetime_killed ();
11591159

11601160
robo_anarchy_suicide_penalty();
11611161
}
11621162
else
1163-
HUD_init_message(HM_MULTI, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_NONPLAY );
1163+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_NONPLAY );
11641164

11651165
add_observatory_stat(killed_pnum, OBSEV_DEATH | OBSEV_REACTOR);
11661166

@@ -1172,21 +1172,21 @@ void multi_compute_kill(int killer, int killed)
11721172
if (killer_id==PMINE_ID && killer_type!=OBJ_ROBOT)
11731173
{
11741174
if (killed_pnum == Player_num)
1175-
HUD_init_message_literal(HM_MULTI, "You were killed by a mine!");
1175+
HUD_init_message_literal(HM_MULTI | HM_KILLFEED, "You were killed by a mine!");
11761176
else
1177-
HUD_init_message(HM_MULTI, "%s was killed by a mine!",killed_name);
1177+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s was killed by a mine!",killed_name);
11781178
}
11791179
else
11801180
{
11811181
if (killed_pnum == Player_num)
11821182
{
1183-
HUD_init_message(HM_MULTI, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_ROBOT);
1183+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s.", TXT_YOU_WERE, TXT_KILLED_BY_ROBOT);
11841184
multi_add_lifetime_killed();
11851185

11861186
robo_anarchy_suicide_penalty();
11871187
}
11881188
else
1189-
HUD_init_message(HM_MULTI, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_ROBOT );
1189+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s.", killed_name, TXT_WAS, TXT_KILLED_BY_ROBOT );
11901190
}
11911191
Players[killed_pnum].net_killed_total++;
11921192

@@ -1230,11 +1230,11 @@ void multi_compute_kill(int killer, int killed)
12301230

12311231
if (killer_pnum == Player_num)
12321232
{
1233-
HUD_init_message(HM_MULTI, "%s %s %s!", TXT_YOU, TXT_KILLED, TXT_YOURSELF );
1233+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", TXT_YOU, TXT_KILLED, TXT_YOURSELF );
12341234
multi_add_lifetime_killed();
12351235
}
12361236
else
1237-
HUD_init_message(HM_MULTI, "%s %s", killed_name, TXT_SUICIDE);
1237+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s", killed_name, TXT_SUICIDE);
12381238

12391239
/* Bounty mode needs some lovin' */
12401240
if( Game_mode & GM_BOUNTY && killed_pnum == Bounty_target && multi_i_am_master() )
@@ -1311,7 +1311,7 @@ void multi_compute_kill(int killer, int killed)
13111311
}
13121312

13131313
if (killer_pnum == Player_num) {
1314-
HUD_init_message(HM_MULTI, "%s %s %s!", TXT_YOU, TXT_KILLED, killed_name);
1314+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", TXT_YOU, TXT_KILLED, killed_name);
13151315
multi_add_lifetime_kills();
13161316
if ((Game_mode & GM_MULTI_COOP) && (Players[Player_num].score >= 1000))
13171317
add_points_to_score(-1000);
@@ -1321,7 +1321,7 @@ void multi_compute_kill(int killer, int killed)
13211321
}
13221322
else if (killed_pnum == Player_num)
13231323
{
1324-
HUD_init_message(HM_MULTI, "%s %s %s!", killer_name, TXT_KILLED, TXT_YOU);
1324+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", killer_name, TXT_KILLED, TXT_YOU);
13251325
multi_add_lifetime_killed();
13261326
if (Game_mode & GM_HOARD)
13271327
{
@@ -1332,7 +1332,7 @@ void multi_compute_kill(int killer, int killed)
13321332
}
13331333
}
13341334
else
1335-
HUD_init_message(HM_MULTI, "%s %s %s!", killer_name, TXT_KILLED, killed_name);
1335+
HUD_init_message(HM_MULTI | HM_KILLFEED, "%s %s %s!", killer_name, TXT_KILLED, killed_name);
13361336

13371337
add_observatory_stat(killed_pnum, OBSEV_DEATH | OBSEV_PLAYER);
13381338
add_observatory_stat(killer_pnum, OBSEV_KILL | OBSEV_PLAYER);

0 commit comments

Comments
 (0)