Add a sv_doors_always_open cvar which will keep open doors en. Useful for public...
authorMorosophos <morosophos@teichisma.info>
Mon, 9 Sep 2019 20:46:57 +0000 (23:46 +0300)
committerMorosophos <morosophos@teichisma.info>
Mon, 9 Sep 2019 20:46:57 +0000 (23:46 +0300)
qcsrc/common/mapobjects/func/door.qc
qcsrc/server/autocvars.qh
xonotic-server.cfg

index aa5b54a..66de9fb 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);
 
index 7f3c0b7..4abfdb6 100644 (file)
@@ -290,6 +290,7 @@ string autocvar_sv_defaultplayermodel_pink;
 string autocvar_sv_defaultplayermodel_red;
 string autocvar_sv_defaultplayermodel_yellow;
 int autocvar_sv_defaultplayerskin;
+bool autocvar_sv_doors_always_open;
 bool autocvar_sv_doublejump;
 bool autocvar_sv_eventlog;
 bool autocvar_sv_eventlog_console;
index 89a0478..d337896 100644 (file)
@@ -565,3 +565,4 @@ set sv_showspectators 1 "Show who's spectating who in the player info panel when
 set sv_damagetext 2 "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage"
 
 set sv_showfps 5 "Show player's FPS counters in the scoreboard. This setting acts as a delay in seconds between updates"
+set autocvar_sv_doors_always_open 0 "If set to 1 don't close doors which after they were open"