]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 aa5b54a60ed4ba7ce22dbd761d2321610f989392..66de9fbb378ab91ede399beef489793e12475af5 100644 (file)
@@ -670,10 +670,18 @@ void door_init_shared(entity this)
                precache_sound(this.noise2);
        }
 
                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;
        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);
 
        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);
 
 
        settouch(this, door_touch);
 
index 7f3c0b7207b0b21f257e76ad357c215d5aa9de17..4abfdb6bcc2bdc3d19731e79dfa7dcffe5813dbe 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;
 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;
 bool autocvar_sv_doublejump;
 bool autocvar_sv_eventlog;
 bool autocvar_sv_eventlog_console;
index 89a04782f8828ccf4329fe30a10a48121bfdf864..d3378967a6ae5dde48331d50f1743ed701bd0bd5 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 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"