]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_plats.qc
Merge branch 'master' of ssh://gitlab.com/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_plats.qc
index be3c6b07fd5c34e32ab130c7267671ad9878757e..b93b1d57770c1748b392f496250180963fcd8030 100644 (file)
@@ -1,3 +1,27 @@
+#include "_all.qh"
+
+#include "bot/bot.qh"
+
+#include "command/common.qh"
+
+#include "g_damage.qh"
+#include "item_key.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/all.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
+#include "../warpzonelib/util_server.qh"
+
+.float height;
+
 .float dmgtime2;
 void generic_plat_blocked()
 {
@@ -37,19 +61,19 @@ void plat_spawn_inside_trigger()
 
        tmin = self.absmin + '25 25 0';
        tmax = self.absmax - '25 25 -8';
-       tmin_z = tmax.z - (self.pos1_z - self.pos2_z + 8);
+       tmin.z = tmax.z - (self.pos1_z - self.pos2_z + 8);
        if (self.spawnflags & PLAT_LOW_TRIGGER)
-               tmax_z = tmin.z + 8;
+               tmax.z = tmin.z + 8;
 
        if (self.size.x <= 50)
        {
-               tmin_x = (self.mins.x + self.maxs.x) / 2;
-               tmax_x = tmin.x + 1;
+               tmin.x = (self.mins.x + self.maxs.x) / 2;
+               tmax.x = tmin.x + 1;
        }
        if (self.size.y <= 50)
        {
-               tmin_y = (self.mins.y + self.maxs.y) / 2;
-               tmax_y = tmin.y + 1;
+               tmin.y = (self.mins.y + self.maxs.y) / 2;
+               tmax.y = tmin.y + 1;
        }
 
        if(tmin.x < tmax.x)
@@ -196,15 +220,15 @@ float set_platmovetype(entity e, string s)
 
        if(n > 2)
                if(argv(2) == "force")
-                       return TRUE; // no checking, return immediately
+                       return true; // no checking, return immediately
 
        if(!cubic_speedfunc_is_sane(e.platmovetype_start, e.platmovetype_end))
        {
                objerror("Invalid platform move type; platform would go in reverse, which is not allowed.");
-               return FALSE;
+               return false;
        }
 
-       return TRUE;
+       return true;
 }
 
 void spawnfunc_path_corner()
@@ -309,13 +333,13 @@ void train_wait()
                else // linear movement
                        ang = targ.origin - (self.origin - self.view_ofs); // use the origin of the next path_corner
                ang = vectoangles(ang);
-               ang_x = -ang.x; // flip up / down orientation
+               ang.x = -ang.x; // flip up / down orientation
 
                if(self.wait > 0) // slow turning
                        SUB_CalcAngleMove(ang, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
                else // instant turning
                        SUB_CalcAngleMove(ang, TSPEED_TIME, 0.0000001, train_wait);
-               self.train_wait_turning = TRUE;
+               self.train_wait_turning = true;
                return;
        }
 
@@ -324,7 +348,7 @@ void train_wait()
 
        if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
        {
-               self.train_wait_turning = FALSE;
+               self.train_wait_turning = false;
                train_next();
        }
        else
@@ -417,10 +441,10 @@ void spawnfunc_func_train()
        if (!InitMovingBrushTrigger())
                return;
        self.effects |= EF_LOWPRECISION;
-       
+
        if (self.spawnflags & 2)
        {
-               self.platmovetype_turn = TRUE;
+               self.platmovetype_turn = true;
                self.view_ofs = '0 0 0'; // don't offset a rotating train, origin works differently now
        }
        else
@@ -766,7 +790,7 @@ void button_touch()
        button_fire ();
 }
 
-void button_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void button_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        if(self.spawnflags & DOOR_NOSPLASH)
                if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
@@ -995,12 +1019,12 @@ float door_check_keys(void) {
 
        // no key needed
        if (!door.itemkeys)
-               return TRUE;
+               return true;
 
        // this door require a key
        // only a player can have a key
        if (!IS_PLAYER(other))
-               return FALSE;
+               return false;
 
        if (item_keys_usekey(door, other)) {
                // some keys were used
@@ -1022,9 +1046,9 @@ float door_check_keys(void) {
                // door is now unlocked
                play2(other, "misc/talk.wav");
                Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_UNLOCKED);
-               return TRUE;
+               return true;
        } else
-               return FALSE;
+               return false;
 }
 
 
@@ -1126,7 +1150,7 @@ void door_trigger_touch()
 }
 
 
-void door_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void door_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        entity oself;
        if(self.spawnflags & DOOR_NOSPLASH)
@@ -1318,18 +1342,18 @@ float LinkDoors_isconnected(entity e1, entity e2, entity pass)
 {
        float DELTA = 4;
        if (e1.absmin.x > e2.absmax.x + DELTA)
-               return FALSE;
+               return false;
        if (e1.absmin.y > e2.absmax.y + DELTA)
-               return FALSE;
+               return false;
        if (e1.absmin.z > e2.absmax.z + DELTA)
-               return FALSE;
+               return false;
        if (e2.absmin.x > e1.absmax.x + DELTA)
-               return FALSE;
+               return false;
        if (e2.absmin.y > e1.absmax.y + DELTA)
-               return FALSE;
+               return false;
        if (e2.absmin.z > e1.absmax.z + DELTA)
-               return FALSE;
-       return TRUE;
+               return false;
+       return true;
 }
 
 /*
@@ -1389,17 +1413,17 @@ void LinkDoors()
                if((t.message != "") && (self.message == ""))
                        self.message = t.message;
                if (t.absmin.x < cmins.x)
-                       cmins_x = t.absmin.x;
+                       cmins.x = t.absmin.x;
                if (t.absmin.y < cmins.y)
-                       cmins_y = t.absmin.y;
+                       cmins.y = t.absmin.y;
                if (t.absmin.z < cmins.z)
-                       cmins_z = t.absmin.z;
+                       cmins.z = t.absmin.z;
                if (t.absmax.x > cmaxs.x)
-                       cmaxs_x = t.absmax.x;
+                       cmaxs.x = t.absmax.x;
                if (t.absmax.y > cmaxs.y)
-                       cmaxs_y = t.absmax.y;
+                       cmaxs.y = t.absmax.y;
                if (t.absmax.z > cmaxs.z)
-                       cmaxs_z = t.absmax.z;
+                       cmaxs.z = t.absmax.z;
                if(t.enemy == self)
                        break;
        }
@@ -1608,7 +1632,7 @@ void spawnfunc_func_door_rotating()
        else // Z
                self.movedir = '0 1 0';
 
-       if (self.angles_y ==0) self.angles_y = 90;
+       if (self.angles.y ==0) self.angles_y = 90;
 
        self.movedir = self.movedir * self.angles.y;
        self.angles = '0 0 0';
@@ -1702,7 +1726,7 @@ void fd_secret_use()
        string message_save;
 
        self.health = 10000;
-       self.bot_attack = TRUE;
+       self.bot_attack = true;
 
        // exit if still moving around...
        if (self.origin != self.oldorigin)
@@ -1746,7 +1770,7 @@ void fd_secret_use()
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
 }
 
-void fd_secret_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void fd_secret_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        fd_secret_use();
 }