]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Merge branch 'master' into TimePath/deathtypes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index 2b72368fa56f3a4fcfca3f02fb9f821a81cd2bfd..64c7cec19e17ea2627faf89f40ca8d91bd95710a 100644 (file)
@@ -1,5 +1,4 @@
 #include "cheats.qh"
-#include "_all.qh"
 
 #include "g_damage.qh"
 #include "race.qh"
@@ -10,8 +9,7 @@
 #include "weapons/tracing.qh"
 
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
-#include "../common/effects.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/util.qh"
 
 #include "../common/monsters/all.qh"
 
 #include "../common/triggers/func/breakable.qh"
 
-#include "../csqcmodellib/sv_model.qh"
+#include "../lib/csqcmodel/sv_model.qh"
 
-#include "../warpzonelib/anglestransform.qh"
-#include "../warpzonelib/util_server.qh"
+#include "../lib/warpzone/anglestransform.qh"
+#include "../lib/warpzone/util_server.qh"
 
 void CopyBody(float keepvelocity);
 
@@ -129,8 +127,8 @@ void info_autoscreenshot_findtarget()
        self.angles_y = a.y;
        // we leave Rick Roll alone
 }
-void spawnfunc_info_autoscreenshot()
-{SELFPARAM();
+spawnfunc(info_autoscreenshot)
+{
        if(++num_autoscreenshot > autocvar_g_max_info_autoscreenshot)
        {
                objerror("Too many info_autoscreenshot entitites. FAIL!");
@@ -283,11 +281,11 @@ float CheatImpulse(float i)
                                e = self;
 
                        Send_Effect(EFFECT_ROCKET_EXPLODE, e.origin, '0 0 0', 1);
-                       sound(e, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
+                       sound(e, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
 
                        e2 = spawn();
                        setorigin(e2, e.origin);
-                       RadiusDamage(e2, self, 1000, 0, 128, world, world, 500, DEATH_CHEAT, e);
+                       RadiusDamage(e2, self, 1000, 0, 128, world, world, 500, DEATH_CHEAT.m_id, e);
                        remove(e2);
 
                        LOG_INFO("404 Sportsmanship not found.\n");
@@ -372,7 +370,7 @@ float CheatCommand(float argc)
                                                e.angles = fixedvectoangles2(trace_plane_normal, v_forward);
                                                e.angles = AnglesTransform_ApplyToAngles(e.angles, '-90 0 0'); // so unrotated models work
                                        }
-                                       WITH(entity, self, e, spawnfunc_func_breakable());
+                                       WITH(entity, self, e, spawnfunc_func_breakable(e));
                                        // now, is it valid?
                                        if(f == 0)
                                        {
@@ -409,7 +407,7 @@ float CheatCommand(float argc)
                        e.think = DragBox_Think;
                        e.nextthink = time;
                        e.solid = -1; // black
-                       setmodel(e, "null"); // network it
+                       setmodel(e, MDL_Null); // network it
                        if(argc == 4)
                                e.cnt = stof(argv(1));
                        else
@@ -418,7 +416,7 @@ float CheatCommand(float argc)
                        e.aiment = spawn();
                        e.aiment.classname = "dragbox_corner_1";
                        e.aiment.owner = e;
-                       setmodel(e.aiment, "models/marker.md3");
+                       setmodel(e.aiment, MDL_MARKER);
                        e.aiment.skin = 0;
                        setsize(e.aiment, '0 0 0', '0 0 0');
                        if(argc == 4)
@@ -432,7 +430,7 @@ float CheatCommand(float argc)
                        e.enemy = spawn();
                        e.enemy.classname = "dragbox_corner_2";
                        e.enemy.owner = e;
-                       setmodel(e.enemy, "models/marker.md3");
+                       setmodel(e.enemy, MDL_MARKER);
                        e.enemy.skin = 1;
                        setsize(e.enemy, '0 0 0', '0 0 0');
                        end = normalize(self.origin + self.view_ofs - e.aiment.origin);
@@ -464,7 +462,7 @@ float CheatCommand(float argc)
                        e.think = DragBox_Think;
                        e.nextthink = time;
                        e.solid = 0; // nothing special
-                       setmodel(e, "models/marker.md3");
+                       setmodel(e, MDL_MARKER);
                        setsize(e, PL_MIN, PL_MAX);
                        e.skin = 2;
                        if(argc == 3)
@@ -1084,19 +1082,19 @@ void DragBox_Think()
        if(self.cnt == -1) // actually race_place -1
        {
                // show "10 10" for qualifying spawns
-               setmodel(self.killindicator, "models/sprites/10.spr32");
-               setmodel(self.killindicator.killindicator, "models/sprites/10.spr32");
+               setmodel(self.killindicator, MDL_NUM(10));
+               setmodel(self.killindicator.killindicator, MDL_NUM(10));
        }
        else if(self.cnt == -2) // actually race_place 0
        {
                // show "10 0" for loser spawns
-               setmodel(self.killindicator, "models/sprites/10.spr32");
-               setmodel(self.killindicator.killindicator, "models/sprites/0.spr32");
+               setmodel(self.killindicator, MDL_NUM(10));
+               setmodel(self.killindicator.killindicator, MDL_NUM(0));
        }
        else
        {
-               setmodel(self.killindicator, strcat("models/sprites/", ftos(self.cnt % 10), ".spr32"));
-               setmodel(self.killindicator.killindicator, strcat("models/sprites/", ftos(floor(self.cnt / 10)), ".spr32"));
+               setmodel(self.killindicator, MDL_NUM(self.cnt % 10));
+               setmodel(self.killindicator.killindicator, MDL_NUM(floor(self.cnt / 10)));
        }
 
        self.nextthink = time;