]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/door.qc
Merge branch 'master' into martin-t/damagetext
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / door.qc
index 2b3decf64ff3dcda89bf58bfeaaf8412de15e37f..b0cc44f96543adbc7c23c4f14cca4b821f58492f 100644 (file)
@@ -1,3 +1,4 @@
+#include "door.qh"
 /*
 
 Doors are similar to buttons, but can spawn a fat trigger field around them
@@ -441,7 +442,7 @@ void door_spawnfield(entity this, vector fmins, vector fmaxs)
        vector  t1 = fmins, t2 = fmaxs;
 
        trigger = new(doortriggerfield);
-       trigger.movetype = MOVETYPE_NONE;
+       set_movetype(trigger, MOVETYPE_NONE);
        trigger.solid = SOLID_TRIGGER;
        trigger.owner = this;
 #ifdef SVQC
@@ -525,7 +526,7 @@ void LinkDoors(entity this)
                        break;
                }
        }
-       LOG_TRACE("\n");
+       LOG_TRACE("");
 
        // collect health, targetname, message, size
        cmins = this.absmin;
@@ -731,12 +732,13 @@ spawnfunc(func_door)
 
        if (this.sounds > 0)
        {
-               precache_sound ("plats/medplat1.wav");
-               precache_sound ("plats/medplat2.wav");
                this.noise2 = "plats/medplat1.wav";
                this.noise1 = "plats/medplat2.wav";
        }
 
+       if(this.noise1 && this.noise1 != "") { precache_sound(this.noise1); }
+       if(this.noise2 && this.noise2 != "") { precache_sound(this.noise2); }
+
        if (!this.speed)
                this.speed = 100;
        if (!this.wait)
@@ -815,7 +817,7 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
                this.SUB_LTIME = ReadCoord();
 
                this.solid = SOLID_BSP;
-               this.movetype = MOVETYPE_PUSH;
+               set_movetype(this, MOVETYPE_PUSH);
                this.use = door_use;
 
                LinkDoors(this);
@@ -824,10 +826,7 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
                        door_init_startopen(this);
 
                this.move_time = time;
-               this.move_origin = this.origin;
-               this.move_movetype = MOVETYPE_PUSH;
-               this.move_angles = this.angles;
-               this.move_blocked = door_blocked;
+               set_movetype(this, MOVETYPE_PUSH);
        }
 
        if(sf & SF_TRIGGER_RESET)
@@ -841,7 +840,6 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
                this.origin_y = ReadCoord();
                this.origin_z = ReadCoord();
                setorigin(this, this.origin);
-               this.move_origin = this.origin;
 
                this.pos1_x = ReadCoord();
                this.pos1_y = ReadCoord();