]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'morosophos/packer-doors-always-open' into 'master'
authorMario <mario.mario@y7mail.com>
Wed, 25 Sep 2019 23:33:49 +0000 (23:33 +0000)
committerMario <mario.mario@y7mail.com>
Wed, 25 Sep 2019 23:33:49 +0000 (23:33 +0000)
Add a sv_doors_always_open cvar which will keep open doors open. Useful for public defrag servers.

See merge request xonotic/xonotic-data.pk3dir!711

qcsrc/common/mapobjects/func/door.qc
qcsrc/server/autocvars.qh
xonotic-server.cfg

index aa5b54a60ed4ba7ce22dbd761d2321610f989392..e9fd04b7263398217e507800c47261f50ab29696 100644 (file)
@@ -670,10 +670,15 @@ 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 +731,14 @@ 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 = max(750, this.speed);
+        }
+        else if (!this.speed)
+        {
+                this.speed = 100;
+        }
 
        settouch(this, door_touch);
 
index 274b8be90b0a22187b319f340943b9e2b6c134f4..19f76c4f0f2531e777286ee3cc97a7d9f854ba2b 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 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 autocvar_sv_doors_always_open 0 "If set to 1 don't close doors which after they were open"