From 0ac11955df542c04eeffed374fe3d68122d295e2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Jul 2020 21:09:11 +0200 Subject: [PATCH] - improve message spam prevention. --- source/games/duke/src/game_misc.cpp | 8 +++----- source/games/duke/src/types.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 475ff30fd..0b72832a5 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -147,12 +147,10 @@ void FTA(int q, struct player_struct* p) if (hud_messages == 0 || q < 0 || !(p->gm & MODE_GAME)) return; - if (p->ftq != q) + if (p->ftq != q || totalclock - p->ftt > TICRATE) { - if (q == QUOTE_DEAD || q == QUOTE_SQUISHED || q == QUOTE_BOOTS_ON) - { - p->ftq = q; - } + p->ftq = q; + p->ftt = totalclock; auto qu = quoteMgr.GetQuote(q); if (p == &ps[screenpeek] && qu[0] != '\0') { diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index d1a3ccd52..f86c7758f 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -125,7 +125,7 @@ struct player_struct int bobcounter, weapon_sway; int pals_time, randomflamex, crack_time; - int aim_mode, auto_aim; + int aim_mode, auto_aim, ftt; short cursectnum, last_extra, subweapon; short ammo_amount[MAX_WEAPONS], wackedbyactor, frag, fraggedself;