]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
q3df compat: show "x more frags needed" message when using a target_fragsFilter with...
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 17 Feb 2023 22:11:21 +0000 (23:11 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 17 Feb 2023 22:11:21 +0000 (23:11 +0100)
qcsrc/server/compat/quake3.qc

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