]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move door_rotating_* functions into the proper file
authorFreddy <schro.sb@gmail.com>
Mon, 5 Mar 2018 13:50:18 +0000 (14:50 +0100)
committerFreddy <schro.sb@gmail.com>
Mon, 5 Mar 2018 13:50:18 +0000 (14:50 +0100)
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_rotating.qc
qcsrc/common/triggers/func/door_rotating.qh

index cfccf10a48e05c8566a4d110de74f662c8c2ab9d..21ee89b7b18ec646be01aab129c65b4ed5acbf2e 100644 (file)
@@ -24,8 +24,6 @@ THINK FUNCTIONS
 
 void door_go_down(entity this);
 void door_go_up(entity this, entity actor, entity trigger);
-void door_rotating_go_down(entity this);
-void door_rotating_go_up(entity this, entity oth);
 
 void door_blocked(entity this, entity blocker)
 {
@@ -351,66 +349,6 @@ void door_generic_plat_blocked(entity this, entity blocker)
        }
 }
 
-void door_rotating_hit_top(entity this)
-{
-       if (this.noise1 != "")
-               _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
-       this.state = STATE_TOP;
-       if (this.spawnflags & DOOR_TOGGLE)
-               return;         // don't come down automatically
-       setthink(this, door_rotating_go_down);
-       this.nextthink = this.ltime + this.wait;
-}
-
-void door_rotating_hit_bottom(entity this)
-{
-       if (this.noise1 != "")
-               _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
-       if (this.lip==666) // this.lip is used to remember reverse opening direction for door_rotating
-       {
-               this.pos2 = '0 0 0' - this.pos2;
-               this.lip = 0;
-       }
-       this.state = STATE_BOTTOM;
-}
-
-void door_rotating_go_down(entity this)
-{
-       if (this.noise2 != "")
-               _sound (this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
-       if (this.max_health)
-       {
-               this.takedamage = DAMAGE_YES;
-               this.health = this.max_health;
-       }
-
-       this.state = STATE_DOWN;
-       SUB_CalcAngleMove (this, this.pos1, TSPEED_LINEAR, this.speed, door_rotating_hit_bottom);
-}
-
-void door_rotating_go_up(entity this, entity oth)
-{
-       if (this.state == STATE_UP)
-               return;         // already going up
-
-       if (this.state == STATE_TOP)
-       {       // reset top wait time
-               this.nextthink = this.ltime + this.wait;
-               return;
-       }
-       if (this.noise2 != "")
-               _sound (this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
-       this.state = STATE_UP;
-       SUB_CalcAngleMove (this, this.pos2, TSPEED_LINEAR, this.speed, door_rotating_hit_top);
-
-       string oldmessage;
-       oldmessage = this.message;
-       this.message = "";
-       SUB_UseTargets(this, NULL, oth); // TODO: is oth needed here?
-       this.message = oldmessage;
-}
-
-
 /*
 =========================================
 door trigger
index d1849ab8e6a46bea71086e790c922cea1a77ee75..f52b221ba0127c28a6eda5ff9b0b079c7c5578f7 100644 (file)
@@ -1,5 +1,4 @@
 #include "door_rotating.qh"
-#ifdef SVQC
 /*QUAKED spawnfunc_func_door_rotating (0 .5 .8) ? START_OPEN BIDIR DOOR_DONT_LINK BIDIR_IN_DOWN x TOGGLE X_AXIS Y_AXIS
 if two doors touch, they are assumed to be connected and operate as a unit.
 
@@ -28,6 +27,68 @@ START_OPEN causes the door to move to its destination when spawned, and operate
 FIXME: only one sound set available at the time being
 */
 
+#ifdef GAMEQC
+void door_rotating_hit_top(entity this)
+{
+       if (this.noise1 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
+       this.state = STATE_TOP;
+       if (this.spawnflags & DOOR_TOGGLE)
+               return;         // don't come down automatically
+       setthink(this, door_rotating_go_down);
+       this.nextthink = this.ltime + this.wait;
+}
+
+void door_rotating_hit_bottom(entity this)
+{
+       if (this.noise1 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
+       if (this.lip==666) // this.lip is used to remember reverse opening direction for door_rotating
+       {
+               this.pos2 = '0 0 0' - this.pos2;
+               this.lip = 0;
+       }
+       this.state = STATE_BOTTOM;
+}
+
+void door_rotating_go_down(entity this)
+{
+       if (this.noise2 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       if (this.max_health)
+       {
+               this.takedamage = DAMAGE_YES;
+               this.health = this.max_health;
+       }
+
+       this.state = STATE_DOWN;
+       SUB_CalcAngleMove (this, this.pos1, TSPEED_LINEAR, this.speed, door_rotating_hit_bottom);
+}
+
+void door_rotating_go_up(entity this, entity oth)
+{
+       if (this.state == STATE_UP)
+               return;         // already going up
+
+       if (this.state == STATE_TOP)
+       {       // reset top wait time
+               this.nextthink = this.ltime + this.wait;
+               return;
+       }
+       if (this.noise2 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       this.state = STATE_UP;
+       SUB_CalcAngleMove (this, this.pos2, TSPEED_LINEAR, this.speed, door_rotating_hit_top);
+
+       string oldmessage;
+       oldmessage = this.message;
+       this.message = "";
+       SUB_UseTargets(this, NULL, oth); // TODO: is oth needed here?
+       this.message = oldmessage;
+}
+#endif
+
+#ifdef SVQC
 void door_rotating_reset(entity this)
 {
        this.angles = this.pos1;
@@ -44,7 +105,6 @@ void door_rotating_init_startopen(entity this)
        this.pos1 = this.movedir;
 }
 
-
 spawnfunc(func_door_rotating)
 {
        // possible TODO: support for Quake1 keys (like func_door)
index efaac5d56ae4add89a6275afc8f17ad4ef7e30c2..eaffcf6061467edfd782fa4d014a6b97816cc587 100644 (file)
@@ -6,3 +6,8 @@ const int BIDIR_IN_DOWN = BIT(3);
 
 const int DOOR_ROTATING_XAXIS = BIT(6);
 const int DOOR_ROTATING_YAXIS = BIT(7);
+
+#ifdef GAMEQC
+void door_rotating_go_down(entity this);
+void door_rotating_go_up(entity this, entity oth);
+#endif