From d531f4b02917345ad9faefed1ff77cbf425987d2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 28 Jul 2020 20:43:33 +0200 Subject: [PATCH] - reduce message spam when holding down the quick_kick button. If not kept in check this will flood the console with endless messages. --- source/games/duke/src/input.cpp | 4 +++- source/games/duke/src/types.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index ff755869a..768bf08cc 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -281,10 +281,12 @@ void hud_input(int snum) if (GetGameVarID(g_iReturnVarID, -1, snum) == 0) { p->quick_kick = 14; - FTA(QUOTE_MIGHTY_FOOT, p); + if (!p->quick_kick_msg && snum == screenpeek) FTA(QUOTE_MIGHTY_FOOT, p); + p->quick_kick_msg = true; } } } + if (!PlayerInput(snum, SKB_QUICK_KICK)) p->quick_kick_msg = false; if (!PlayerInputBits(snum, SKB_INTERFACE_BITS)) p->interface_toggle_flag = 0; diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 348c498da..07ae6eefa 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -166,6 +166,7 @@ struct player_struct unsigned char toggle_key_flag, knuckle_incs; // ,select_dir; unsigned char walking_snd_toggle, palookup, hard_landing; unsigned char return_to_center; + bool quick_kick_msg; int max_secret_rooms, secret_rooms, max_actors_killed, actors_killed;