From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Fri, 17 Feb 2023 22:11:21 +0000 (+0100) Subject: q3df compat: show "x more frags needed" message when using a target_fragsFilter with... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4c4b50176427e1880bb96f01984762121150f44d;p=xonotic%2Fxonotic-data.pk3dir.git q3df compat: show "x more frags needed" message when using a target_fragsFilter with insufficient frags --- 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) {