]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/func/door.qc
Merge branch 'master' into terencehill/ft_autorevive_progress
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / func / door.qc
index 47fda80f55f1b2591b407c032a203d392bfb6979..e9fd04b7263398217e507800c47261f50ab29696 100644 (file)
@@ -113,7 +113,7 @@ void door_go_down(entity this)
        if (this.max_health)
        {
                this.takedamage = DAMAGE_YES;
-               SetResource(this, RES_HEALTH, this.max_health);
+               SetResourceExplicit(this, RES_HEALTH, this.max_health);
        }
 
        this.state = STATE_DOWN;
@@ -275,7 +275,7 @@ void door_damage(entity this, entity inflictor, entity attacker, float damage, i
 
        if (GetResource(this, RES_HEALTH) <= 0)
        {
-               SetResource(this.owner, RES_HEALTH, this.owner.max_health);
+               SetResourceExplicit(this.owner, RES_HEALTH, this.owner.max_health);
                this.owner.takedamage = DAMAGE_NO;      // will be reset upon return
                door_use(this.owner, attacker, NULL);
        }
@@ -475,7 +475,7 @@ void LinkDoors(entity this)
        for(t = this; ; t = t.enemy)
        {
                if(GetResource(t, RES_HEALTH) && !GetResource(this, RES_HEALTH))
-                       SetResource(this, RES_HEALTH, GetResource(t, RES_HEALTH));
+                       SetResourceExplicit(this, RES_HEALTH, GetResource(t, RES_HEALTH));
                if((t.targetname != "") && (this.targetname == ""))
                        this.targetname = t.targetname;
                if((t.message != "") && (this.message == ""))
@@ -499,7 +499,7 @@ void LinkDoors(entity this)
        // distribute health, targetname, message
        for(t = this; t; t = t.enemy)
        {
-               SetResource(t, RES_HEALTH, GetResource(this, RES_HEALTH));
+               SetResourceExplicit(t, RES_HEALTH, GetResource(this, RES_HEALTH));
                t.targetname = this.targetname;
                t.message = this.message;
                if(t.enemy == this)
@@ -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);