From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 15 Feb 2023 15:15:46 +0000 (+0100) Subject: q3df compat: add support for target_fragsFilter spawnflags X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bedfb90556932756dd135c5fdae6fe20795400b0;p=xonotic%2Fxonotic-data.pk3dir.git q3df compat: add support for target_fragsFilter spawnflags --- 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) {