]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/triggers.qc
Properly support team field on trigger_multiple
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / triggers.qc
index 54e1e09919f06666bb6ff1b22c379b5f7577bc0c..2a76d80c41a7a7f41675d9a06826b2e236683d28 100644 (file)
@@ -22,22 +22,28 @@ void FixSize(entity e)
 
 #ifdef SVQC
 
+bool autocvar_g_triggers_debug = true;
+
 void trigger_init(entity this)
 {
        string m = this.model;
        EXACTTRIGGER_INIT;
-       if(m != "")
-       {
-               precache_model(m);
-               _setmodel(this, m); // no precision needed
+       if(autocvar_g_triggers_debug)
+       {
+               if(m != "")
+               {
+                       precache_model(m);
+                       _setmodel(this, m); // no precision needed
+               }
+               setorigin(this, this.origin);
+               if(this.scale)
+                       setsize(this, this.mins * this.scale, this.maxs * this.scale);
+               else
+                       setsize(this, this.mins, this.maxs);
        }
-       setorigin(this, this.origin);
-       if(this.scale)
-               setsize(this, this.mins * this.scale, this.maxs * this.scale);
-       else
-               setsize(this, this.mins, this.maxs);
 
-       BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
+       if(autocvar_g_triggers_debug)
+               BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
 }
 
 void trigger_link(entity this, bool(entity this, entity to, int sendflags) sendfunc)
@@ -203,6 +209,7 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe
                t.target2 = this.target2;
                t.target3 = this.target3;
                t.target4 = this.target4;
+               t.antiwall_flag = this.antiwall_flag;
                return;
        }
 
@@ -260,7 +267,7 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe
                                {
                                        if(this.target_random)
                                        {
-                                               RandomSelection_Add(t, 0, string_null, 1, 0);
+                                               RandomSelection_AddEnt(t, 1, 0);
                                        }
                                        else
                                        {