]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
q3df compat: add support for target_fragsFilter spawnflags
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Wed, 15 Feb 2023 15:15:46 +0000 (16:15 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Wed, 15 Feb 2023 15:15:46 +0000 (16:15 +0100)
qcsrc/server/compat/quake3.qc

index 9333ebfed50973872e0c0111aba93b4886cde5eb..2dfcde56e766b0720b948760b81756aa074fe7fe 100644 (file)
@@ -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)
 {