From bedfb90556932756dd135c5fdae6fe20795400b0 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 15 Feb 2023 16:15:46 +0100 Subject: [PATCH] q3df compat: add support for target_fragsFilter spawnflags --- qcsrc/server/compat/quake3.qc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index 9333ebfed..2dfcde56e 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -256,12 +256,23 @@ spawnfunc(target_score) this.use = score_use; } +#define FRAGSFILTER_REMOVER BIT(0) +#define FRAGSFILTER_RUNONCE BIT(1) // unused +#define FRAGSFILTER_SILENT BIT(2) // unused in xonotic +#define FRAGSFILTER_RESET BIT(3) + void fragsfilter_use(entity this, entity actor, entity trigger) { if(!IS_PLAYER(actor)) return; if(actor.fragsfilter_cnt >= this.frags) + { + if(this.spawnflags & FRAGSFILTER_RESET) + actor.fragsfilter_cnt = 0; + else if(this.spawnflags & FRAGSFILTER_REMOVER) + actor.fragsfilter_cnt -= this.frags; SUB_UseTargets(this, actor, trigger); + } } spawnfunc(target_fragsFilter) { -- 2.39.2