]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/counter.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / counter.qc
index 8246aed7c329a67c8eaa10cf3f4822186ba62cfc..0e028e6208fd3a9e4e0c1d16da79f07b23bbe91b 100644 (file)
@@ -3,24 +3,25 @@
 void counter_use(entity this, entity actor, entity trigger)
 {
        this.count -= 1;
-       if (this.count < 0)
+       if (this.count < 0) {
                return;
+       }
 
-       if (this.count == 0)
-       {
-               if(IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
+       if (this.count == 0) {
+               if (IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) {
                        Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COMPLETED);
+               }
 
                this.enemy = actor;
                multi_trigger(this);
-       }
-       else
-       {
-               if(IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
-               if(this.count >= 4)
-                       Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER);
-               else
-                       Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, this.count);
+       } else {
+               if (IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) {
+                       if (this.count >= 4) {
+                               Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER);
+                       } else {
+                               Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, this.count);
+                       }
+               }
        }
 }
 
@@ -40,8 +41,9 @@ After the counter has been triggered "count" times (default 2), it will fire all
 spawnfunc(trigger_counter)
 {
        this.wait = -1;
-       if (!this.count)
+       if (!this.count) {
                this.count = 2;
+       }
        this.cnt = this.count;
 
        this.use = counter_use;