From 4c4b50176427e1880bb96f01984762121150f44d Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Fri, 17 Feb 2023 23:11:21 +0100 Subject: [PATCH] q3df compat: show "x more frags needed" message when using a target_fragsFilter with insufficient frags --- qcsrc/server/compat/quake3.qc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index 2dfcde56e..666598d02 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -258,7 +258,7 @@ spawnfunc(target_score) #define FRAGSFILTER_REMOVER BIT(0) #define FRAGSFILTER_RUNONCE BIT(1) // unused -#define FRAGSFILTER_SILENT BIT(2) // unused in xonotic +#define FRAGSFILTER_SILENT BIT(2) #define FRAGSFILTER_RESET BIT(3) void fragsfilter_use(entity this, entity actor, entity trigger) @@ -273,6 +273,12 @@ void fragsfilter_use(entity this, entity actor, entity trigger) actor.fragsfilter_cnt -= this.frags; SUB_UseTargets(this, actor, trigger); } + else if(!(this.spawnflags & FRAGSFILTER_SILENT)) + { + int req_frags = this.frags - actor.fragsfilter_cnt; + centerprint(actor, sprintf("%d more frag%s needed", req_frags, req_frags > 1 ? "s" : "")); + play2(actor, SND(TALK)); + } } spawnfunc(target_fragsFilter) { -- 2.39.2