]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/func/door.qc
Add a sv_doors_always_open cvar which will keep open doors en. Useful for public...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / func / door.qc
index aa5b54a60ed4ba7ce22dbd761d2321610f989392..66de9fbb378ab91ede399beef489793e12475af5 100644 (file)
@@ -670,10 +670,18 @@ void door_init_shared(entity this)
                precache_sound(this.noise2);
        }
 
-       if (!this.wait)
-       {
-               this.wait = 3;
-       }
+        if(autocvar_sv_doors_always_open)
+        {
+                 this.wait = -1;
+        }
+        else
+        {
+                 if (!this.wait)
+                 {
+                       this.wait = 3;
+                 }
+        }
+
        if (!this.lip)
        {
                this.lip = 8;
@@ -726,10 +734,17 @@ spawnfunc(func_door)
        this.pos1 = this.origin;
        this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
 
-       if (!this.speed)
-       {
-               this.speed = 100;
-       }
+        if(autocvar_sv_doors_always_open)
+        {
+                this.speed = 750;
+        }
+        else
+        {
+                if (!this.speed)
+                {
+                        this.speed = 100;
+                }
+        }
 
        settouch(this, door_touch);