From 17dd7a5961d0f0fb859d4087fdb9406307844f83 Mon Sep 17 00:00:00 2001 From: Morosophos Date: Mon, 9 Sep 2019 23:46:57 +0300 Subject: [PATCH] Add a sv_doors_always_open cvar which will keep open doors en. Useful for public defrag servers. --- qcsrc/common/mapobjects/func/door.qc | 31 +++++++++++++++++++++------- qcsrc/server/autocvars.qh | 1 + xonotic-server.cfg | 1 + 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index aa5b54a60..66de9fbb3 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -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); diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 7f3c0b720..4abfdb6bc 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 89a04782f..d3378967a 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -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" -- 2.39.2