]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Propagate this
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index 2b72368fa56f3a4fcfca3f02fb9f821a81cd2bfd..e13678dce5995e6381c3dd248cdb275aecc174a8 100644 (file)
@@ -1,19 +1,19 @@
 #include "cheats.qh"
-#include "_all.qh"
 
 #include "g_damage.qh"
 #include "race.qh"
 #include "../common/triggers/teleporters.qh"
 
-#include "mutators/mutators_include.qh"
+#include "mutators/all.qh"
 
 #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/physics/player.qh>
+
 #include "../common/monsters/all.qh"
 
 #include "../common/weapons/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);
+void CopyBody(entity this, float keepvelocity);
 
 #ifdef NOCHEATS
 
-float CheatImpulse(float i) { return 0; }
+float CheatImpulse(int imp) { return 0; }
 float CheatCommand(float argc) { return 0; }
 float CheatFrame() { return 0; }
 void CheatInit() { cheatcount_total = world.cheatcount; }
 void CheatShutdown() { }
-void CheatInitClient() { }
-void CheatShutdownClient() { }
 void Drag_MoveDrag(entity from, entity to) { }
 
 #else
@@ -56,24 +54,16 @@ void CheatShutdown()
 {
 }
 
-void CheatInitClient()
-{
-}
-
-void CheatShutdownClient()
-{
-}
-
 float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as argument for possible future ACL checking
 {SELFPARAM();
        // dead people cannot cheat
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return 0;
        if(gamestart_sv_cheats < 2 && !IS_PLAYER(self))
                return 0;
 
        // sv_clones
-       if(i == CHIMPULSE_CLONE_MOVING || i == CHIMPULSE_CLONE_STANDING)
+       if(i == CHIMPULSE_CLONE_MOVING.impulse || i == CHIMPULSE_CLONE_STANDING.impulse)
                if(self.lip < sv_clones)
                        return 1;
 
@@ -107,15 +97,15 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
        cheatcount_total += n; \
        e.cheatcount += n
 #define END_CHEAT_FUNCTION() \
-       ADD_CHEATS(self,cheating); \
+       ADD_CHEATS(this, cheating); \
        return attempting
 #define IS_CHEAT(i,argc,fr) \
        if((++attempting, !CheatsAllowed(i,argc,fr))) \
                break
 
 float num_autoscreenshot;
-void info_autoscreenshot_findtarget()
-{SELFPARAM();
+void info_autoscreenshot_findtarget(entity this)
+{
        entity e;
        e = find(world, targetname, self.target);
        if(!e)
@@ -129,8 +119,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!");
@@ -141,19 +131,18 @@ void spawnfunc_info_autoscreenshot()
        // this one just has to exist
 }
 
-float CheatImpulse(float i)
+float CheatImpulse(int imp)
 {SELFPARAM();
        BEGIN_CHEAT_FUNCTION();
-       switch(i)
+       switch(imp)
        {
                entity e, e2;
 
-               case CHIMPULSE_SPEEDRUN_INIT: // deploy personal waypoint
+               case CHIMPULSE_SPEEDRUN_INIT.impulse: // deploy personal waypoint
                        // shared with regular waypoint init, so this is not a cheat by itself
                        if(!self.personal)
                        {
-                               self.personal = spawn();
-                               self.personal.classname = "personal_wp";
+                               self.personal = new(personal_wp);
                        }
                        self.personal.origin = self.origin;
                        self.personal.v_angle = self.v_angle;
@@ -176,27 +165,27 @@ float CheatImpulse(float i)
                        self.personal.invincible_finished = self.invincible_finished;
                        self.personal.teleport_time = time;
                        break; // this part itself doesn't cheat, so let's not count this
-               case CHIMPULSE_CLONE_MOVING:
-                       IS_CHEAT(i, 0, 0);
+               case CHIMPULSE_CLONE_MOVING.impulse:
+                       IS_CHEAT(imp, 0, 0);
                        makevectors (self.v_angle);
                        self.velocity = self.velocity + v_forward * 300;
-                       CopyBody(1);
+                       CopyBody(self, 1);
                        self.lip += 1;
                        self.velocity = self.velocity - v_forward * 300;
                        DID_CHEAT();
                        break;
-               case CHIMPULSE_CLONE_STANDING:
-                       IS_CHEAT(i, 0, 0);
-                       CopyBody(0);
+               case CHIMPULSE_CLONE_STANDING.impulse:
+                       IS_CHEAT(imp, 0, 0);
+                       CopyBody(self, 0);
                        self.lip += 1;
                        DID_CHEAT();
                        break;
-               case CHIMPULSE_GIVE_ALL:
-                       IS_CHEAT(i, 0, 0);
+               case CHIMPULSE_GIVE_ALL.impulse:
+                       IS_CHEAT(imp, 0, 0);
                        CheatCommand(tokenize_console("give all"));
                        break; // already counted as cheat
-               case CHIMPULSE_SPEEDRUN:
-                       IS_CHEAT(i, 0, 0);
+               case CHIMPULSE_SPEEDRUN.impulse:
+                       IS_CHEAT(imp, 0, 0);
                        if(self.personal)
                        {
                                self.speedrunning = true;
@@ -236,13 +225,13 @@ float CheatImpulse(float i)
                                DID_CHEAT();
                                break;
                        }
-                       if(self.deadflag != DEAD_NO)
+                       if(IS_DEAD(self))
                                sprint(self, "UR DEAD AHAHAH))\n");
                        else
                                sprint(self, "No waypoint set, cheater (use g_waypointsprite_personal to set one)\n");
                        break;
-               case CHIMPULSE_TELEPORT:
-                       IS_CHEAT(i, 0, 0);
+               case CHIMPULSE_TELEPORT.impulse:
+                       IS_CHEAT(imp, 0, 0);
                        if(self.movetype == MOVETYPE_NOCLIP)
                        {
                                e = find(world, classname, "info_autoscreenshot");
@@ -270,24 +259,21 @@ float CheatImpulse(float i)
                        }
                        sprint(self, "Emergency teleport could not find a good location, forget it!\n");
                        break;
-               case CHIMPULSE_R00T:
-                       IS_CHEAT(i, 0, 0);
+               case CHIMPULSE_R00T.impulse:
+                       IS_CHEAT(imp, 0, 0);
                        RandomSelection_Init();
-                       FOR_EACH_PLAYER(e)
-                               if(e.deadflag == DEAD_NO)
-                                       if(DIFF_TEAM(e, self))
-                                               RandomSelection_Add(e, 0, string_null, 1, 1);
+                       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, self), LAMBDA(RandomSelection_Add(it, 0, string_null, 1, 1)));
                        if(RandomSelection_chosen_ent)
                                e = RandomSelection_chosen_ent;
                        else
                                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");
@@ -338,9 +324,9 @@ float CheatCommand(float argc)
                                // arguments:
                                //   effectname
                                effectnum = _particleeffectnum(argv(1));
-                               W_SetupShot(self, false, false, "", CH_WEAPON_A, 0);
+                               W_SetupShot(self, false, false, SND_Null, CH_WEAPON_A, 0);
                                traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
-                               trailparticles(self, effectnum, w_shotorg, trace_endpos);
+                               __trailparticles(self, effectnum, w_shotorg, trace_endpos);
                                DID_CHEAT();
                                break;
                        }
@@ -353,7 +339,7 @@ float CheatCommand(float argc)
                                // arguments:
                                //   modelname mode
                                f = stof(argv(2));
-                               W_SetupShot(self, false, false, "", CH_WEAPON_A, 0);
+                               W_SetupShot(self, false, false, SND_Null, CH_WEAPON_A, 0);
                                traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, self);
                                if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1)
                                {
@@ -372,7 +358,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());
+                                       WITHSELF(e, spawnfunc_func_breakable(e));
                                        // now, is it valid?
                                        if(f == 0)
                                        {
@@ -404,21 +390,19 @@ float CheatCommand(float argc)
                        break;
                case "dragbox_spawn": {
                        IS_CHEAT(0, argc, 0);
-                       entity e = spawn();
-                       e.classname = "dragbox_box";
+                       entity e = new(dragbox_box);
                        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
                                e.cnt = max(0, drag_lastcnt);
 
-                       e.aiment = spawn();
-                       e.aiment.classname = "dragbox_corner_1";
+                       e.aiment = new(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)
@@ -429,10 +413,9 @@ float CheatCommand(float argc)
                                setorigin(e.aiment, trace_endpos);
                        }
 
-                       e.enemy = spawn();
-                       e.enemy.classname = "dragbox_corner_2";
+                       e.enemy = new(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);
@@ -444,13 +427,11 @@ float CheatCommand(float argc)
                        else
                                setorigin(e.enemy, e.aiment.origin + 32 * end);
 
-                       e.killindicator = spawn();
-                       e.killindicator.classname = "drag_digit";
+                       e.killindicator = new(drag_digit);
                        e.killindicator.owner = e;
                        setattachment(e.killindicator, e, "");
                        setorigin(e.killindicator, '0 0 -8');
-                       e.killindicator.killindicator = spawn();
-                       e.killindicator.killindicator.classname = "drag_digit";
+                       e.killindicator.killindicator = new(drag_digit);
                        e.killindicator.killindicator.owner = e;
                        setattachment(e.killindicator.killindicator, e, "");
                        setorigin(e.killindicator.killindicator, '0 0 8');
@@ -459,13 +440,12 @@ float CheatCommand(float argc)
                }
                case "dragpoint_spawn": {
                        IS_CHEAT(0, argc, 0);
-                       entity e = spawn();
-                       e.classname = "dragpoint";
+                       entity e = new(dragpoint);
                        e.think = DragBox_Think;
                        e.nextthink = time;
                        e.solid = 0; // nothing special
-                       setmodel(e, "models/marker.md3");
-                       setsize(e, PL_MIN, PL_MAX);
+                       setmodel(e, MDL_MARKER);
+                       setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
                        e.skin = 2;
                        if(argc == 3)
                                e.cnt = stof(argv(1));
@@ -480,13 +460,11 @@ float CheatCommand(float argc)
                                move_out_of_solid(e);
                        }
 
-                       e.killindicator = spawn();
-                       e.killindicator.classname = "drag_digit";
+                       e.killindicator = new(drag_digit);
                        e.killindicator.owner = e;
                        setattachment(e.killindicator, e, "");
                        setorigin(e.killindicator, '0 0 40');
-                       e.killindicator.killindicator = spawn();
-                       e.killindicator.killindicator.classname = "drag_digit";
+                       e.killindicator.killindicator = new(drag_digit);
                        e.killindicator.killindicator.owner = e;
                        setattachment(e.killindicator.killindicator, e, "");
                        setorigin(e.killindicator.killindicator, '0 0 56');
@@ -610,7 +588,7 @@ float CheatCommand(float argc)
                                                        {
                                                                if(vlen(oldself.origin - start) < vlen(e.origin - start))
                                                                        ++effectnum;
-                                                               else if(vlen(oldself.origin - start) == vlen(e.origin - start) && num_for_edict(oldself) < num_for_edict(e))
+                                                               else if(vlen(oldself.origin - start) == vlen(e.origin - start) && etof(oldself) < etof(e))
                                                                        ++effectnum;
                                                        }
                                                        fputs(f, strcat("\"race_place\" \"", ftos(effectnum), "\"\n"));
@@ -715,11 +693,10 @@ float CheatCommand(float argc)
                        break;
                case "teleporttotarget":
                        IS_CHEAT(0, argc, 0);
-                       setself(spawn());
+                       setself(new(cheattriggerteleport));
                        setorigin(self, self.origin);
-                       self.classname = "cheattriggerteleport";
                        self.target = argv(1);
-                       teleport_findtarget();
+                       teleport_findtarget(self);
                        if(!wasfreed(self))
                        {
                                Simple_TeleportPlayer(self, this);
@@ -759,10 +736,10 @@ float CheatFrame()
        switch(0)
        {
                default:
-                       if(self.maycheat || (gamestart_sv_cheats && autocvar_sv_cheats))
+                       if(this.maycheat || (gamestart_sv_cheats && autocvar_sv_cheats))
                        {
                                // use cheat dragging if cheats are enabled
-                               crosshair_trace_plusvisibletriggers(self);
+                               crosshair_trace_plusvisibletriggers(this);
                                Drag(true, true);
                        }
                        else
@@ -802,43 +779,43 @@ float Drag(float force_allow_pick, float ischeat)
        switch(0)
        {
                default:
-                       if(Drag_IsDragging(self))
+                       if(Drag_IsDragging(this))
                        {
-                               if(self.BUTTON_DRAG)
+                               if(PHYS_INPUT_BUTTON_DRAG(this))
                                {
-                                       if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
+                                       if(this.impulse == 10 || this.impulse == 15 || this.impulse == 18)
                                        {
-                                               Drag_MoveForward(self);
-                                               self.impulse = 0;
+                                               Drag_MoveForward(this);
+                                               this.impulse = 0;
                                        }
-                                       else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19)
+                                       else if(this.impulse == 12 || this.impulse == 16 || this.impulse == 19)
                                        {
-                                               Drag_MoveBackward(self);
-                                               self.impulse = 0;
+                                               Drag_MoveBackward(this);
+                                               this.impulse = 0;
                                        }
-                                       else if(self.impulse >= 1 && self.impulse <= 9)
+                                       else if(this.impulse >= 1 && this.impulse <= 9)
                                        {
-                                               Drag_SetSpeed(self, self.impulse - 1);
+                                               Drag_SetSpeed(this, this.impulse - 1);
                                        }
-                                       else if(self.impulse == 14)
+                                       else if(this.impulse == 14)
                                        {
-                                               Drag_SetSpeed(self, 9);
+                                               Drag_SetSpeed(this, 9);
                                        }
 
                                        if(frametime)
-                                               Drag_Update(self);
+                                               Drag_Update(this);
                                }
                                else
                                {
-                                       Drag_Finish(self);
+                                       Drag_Finish(this);
                                }
                        }
                        else
                        {
-                               if(Drag_CanDrag(self))
-                                       if(self.BUTTON_DRAG)
+                               if(Drag_CanDrag(this))
+                                       if(PHYS_INPUT_BUTTON_DRAG(this))
                                        {
-                                               crosshair_trace_plusvisibletriggers(self);
+                                               crosshair_trace_plusvisibletriggers(this);
                                                entity e = trace_ent;
                                                float pick = force_allow_pick;
                                                if (e && !pick)
@@ -848,18 +825,18 @@ float Drag(float force_allow_pick, float ischeat)
                                                        // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
                                                        // it goes out of range while slinging it around.
 
-                                                       if(vlen(self.origin - e.origin) <= autocvar_g_grab_range)
+                                                       if(vlen(this.origin - e.origin) <= autocvar_g_grab_range)
                                                        {
                                                                switch(e.grab)
                                                                {
                                                                        case 0: // can't grab
                                                                                break;
                                                                        case 1: // owner can grab
-                                                                               if(e.owner == self || e.realowner == self)
+                                                                               if(e.owner == this || e.realowner == this)
                                                                                        pick = true;
                                                                                break;
                                                                        case 2: // owner and team mates can grab
-                                                                               if(SAME_TEAM(e.owner, self) || SAME_TEAM(e.realowner, self) || e.team == self.team)
+                                                                               if(SAME_TEAM(e.owner, this) || SAME_TEAM(e.realowner, this) || e.team == this.team)
                                                                                        pick = true;
                                                                                break;
                                                                        case 3: // anyone can grab
@@ -880,7 +857,7 @@ float Drag(float force_allow_pick, float ischeat)
                                                                        Drag_Finish(e.draggedby);
                                                                if(e.tag_entity)
                                                                        detach_sameorigin(e);
-                                                               Drag_Begin(self, e, trace_endpos);
+                                                               Drag_Begin(this, e, trace_endpos);
                                                                if(ischeat)
                                                                        DID_CHEAT();
                                                                return true;
@@ -900,7 +877,7 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
        draggee.draggravity = draggee.gravity;
        draggee.movetype = MOVETYPE_WALK;
        draggee.gravity = 0.00001;
-       draggee.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(draggee);
        draggee.draggedby = dragger;
 
        dragger.dragentity = draggee;
@@ -944,7 +921,7 @@ void Drag_Finish(entity dragger)
        if((draggee.flags & FL_ITEM) && (vlen(draggee.velocity) < 32))
        {
                draggee.velocity = '0 0 0';
-               draggee.flags |= FL_ONGROUND; // floating items are FUN
+               SET_ONGROUND(draggee); // floating items are FUN
        }
 }
 
@@ -1005,7 +982,7 @@ void Drag_Update(entity dragger)
        entity draggee;
 
        draggee = dragger.dragentity;
-       draggee.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(draggee);
 
        curorigin = gettaginfo(draggee, 0);
        curorigin = curorigin + v_forward * dragger.draglocalvector.x + v_right * dragger.draglocalvector.y + v_up * dragger.draglocalvector.z;
@@ -1027,8 +1004,9 @@ void Drag_Update(entity dragger)
        draggee.ltime = max(servertime + serverframetime, draggee.ltime); // fixes func_train breakage
 
        vector vecs = '0 0 0';
-       if(dragger.weaponentity.movedir_x > 0)
-               vecs = dragger.weaponentity.movedir;
+       .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+       if(dragger.(weaponentity).movedir.x > 0)
+               vecs = dragger.(weaponentity).movedir;
 
        vector dv = v_right * -vecs_y + v_up * vecs_z;
 
@@ -1037,7 +1015,7 @@ void Drag_Update(entity dragger)
 
 float Drag_CanDrag(entity dragger)
 {
-       return (dragger.deadflag == DEAD_NO) || (IS_PLAYER(dragger));
+       return (!IS_DEAD(dragger)) || (IS_PLAYER(dragger));
 }
 
 float Drag_IsDragging(entity dragger)
@@ -1069,37 +1047,38 @@ void Drag_MoveDrag(entity from, entity to)
 
 void DragBox_Think()
 {SELFPARAM();
-       if(self.aiment && self.enemy)
+       if(this.aiment && this.enemy)
        {
-               self.origin_x = (self.aiment.origin.x + self.enemy.origin.x) * 0.5;
-               self.origin_y = (self.aiment.origin.y + self.enemy.origin.y) * 0.5;
-               self.origin_z = (self.aiment.origin.z + self.enemy.origin.z) * 0.5;
-               self.maxs_x = fabs(self.aiment.origin.x - self.enemy.origin.x) * 0.5;
-               self.maxs_y = fabs(self.aiment.origin.y - self.enemy.origin.y) * 0.5;
-               self.maxs_z = fabs(self.aiment.origin.z - self.enemy.origin.z) * 0.5;
-               self.mins = -1 * self.maxs;
-               setorigin(self, self.origin); setsize(self, self.mins, self.maxs); // link edict
+               this.origin_x = (this.aiment.origin.x + this.enemy.origin.x) * 0.5;
+               this.origin_y = (this.aiment.origin.y + this.enemy.origin.y) * 0.5;
+               this.origin_z = (this.aiment.origin.z + this.enemy.origin.z) * 0.5;
+               this.maxs_x = fabs(this.aiment.origin.x - this.enemy.origin.x) * 0.5;
+               this.maxs_y = fabs(this.aiment.origin.y - this.enemy.origin.y) * 0.5;
+               this.maxs_z = fabs(this.aiment.origin.z - this.enemy.origin.z) * 0.5;
+               this.mins = -1 * this.maxs;
+               setorigin(this, this.origin);
+               setsize(this, this.mins, this.maxs); // link edict
        }
 
-       if(self.cnt == -1) // actually race_place -1
+       if(this.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(this.killindicator, MDL_NUM(10));
+               setmodel(this.killindicator.killindicator, MDL_NUM(10));
        }
-       else if(self.cnt == -2) // actually race_place 0
+       else if(this.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(this.killindicator, MDL_NUM(10));
+               setmodel(this.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(this.killindicator, MDL_NUM(this.cnt % 10));
+               setmodel(this.killindicator.killindicator, MDL_NUM(floor(this.cnt / 10)));
        }
 
-       self.nextthink = time;
+       this.nextthink = time;
 }
 
 #endif