]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Step 5: complete
authorMario <mario@smbclan.net>
Fri, 10 Jun 2016 14:32:38 +0000 (00:32 +1000)
committerMario <mario@smbclan.net>
Fri, 10 Jun 2016 14:32:38 +0000 (00:32 +1000)
120 files changed:
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/effects/qc/lightningarc.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/nix/nix.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/mutators/mutator/physical_items/physical_items.qc
qcsrc/common/mutators/mutator/sandbox/sandbox.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/physics/movelib.qh
qcsrc/common/t_items.qc
qcsrc/common/triggers/func/bobbing.qc
qcsrc/common/triggers/func/button.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_rotating.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/fourier.qc
qcsrc/common/triggers/func/ladder.qc
qcsrc/common/triggers/func/pendulum.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/func/vectormamamam.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/trigger/gravity.qc
qcsrc/common/triggers/trigger/heal.qc
qcsrc/common/triggers/trigger/hurt.qc
qcsrc/common/triggers/trigger/impulse.qc
qcsrc/common/triggers/trigger/keylock.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/secret.qc
qcsrc/common/triggers/trigger/swamp.qc
qcsrc/common/triggers/trigger/teleport.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/triggers/triggers.qc
qcsrc/common/triggers/triggers.qh
qcsrc/common/turrets/checkpoint.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret.qh
qcsrc/common/turrets/turret/ewheel.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/fusionreactor.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/util.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/lib/defer.qh
qcsrc/lib/self.qh
qcsrc/lib/warpzone/server.qc
qcsrc/server/bot/aim.qc
qcsrc/server/bot/aim.qh
qcsrc/server/cheats.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/common.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_lights.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_subs.qh
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/item_key.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/pathlib/debug.qc
qcsrc/server/race.qc
qcsrc/server/weapons/weaponsystem.qc

index 8cb4a2aa18ff6dcfff9065b62ad01c2b656919af..605d42e671a86dd7cf55b020d720fb1d83ac64ac 100644 (file)
@@ -87,19 +87,19 @@ void Casing_Touch(entity this)
 {
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
     {
 {
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
     {
-        Casing_Delete(self);
+        Casing_Delete(this);
         return;
     }
 
         return;
     }
 
-    if (!self.silent)
+    if (!this.silent)
     if (!trace_ent || trace_ent.solid == SOLID_BSP)
     {
     if (!trace_ent || trace_ent.solid == SOLID_BSP)
     {
-        if(vdist(self.velocity, >, 50))
+        if(vdist(this.velocity, >, 50))
         {
         {
-            if (time >= self.nextthink)
+            if (time >= this.nextthink)
             {
                 Sound s;
             {
                 Sound s;
-                switch (self.state)
+                switch (this.state)
                 {
                     case 1:
                         s = SND_CASINGS_RANDOM();
                 {
                     case 1:
                         s = SND_CASINGS_RANDOM();
@@ -109,12 +109,12 @@ void Casing_Touch(entity this)
                         break;
                 }
 
                         break;
                 }
 
-                sound (self, CH_SHOTS, s, VOL_BASE, ATTEN_LARGE);
+                sound (this, CH_SHOTS, s, VOL_BASE, ATTEN_LARGE);
             }
         }
     }
 
             }
         }
     }
 
-    self.nextthink = time + 0.2;
+    this.nextthink = time + 0.2;
 }
 
 void Casing_Damage(entity this, float thisdmg, int hittype, vector org, vector thisforce)
 }
 
 void Casing_Damage(entity this, float thisdmg, int hittype, vector org, vector thisforce)
index 20b050c3a4a633ea225e8e7a2e0f523ce17991f1..bc82b50d0c8e955355afaf0ed491ea0cca7e73c0 100644 (file)
@@ -114,7 +114,7 @@ void new_te_bloodshower (int ef, vector org, float explosionspeed, int howmany)
 void SUB_RemoveOnNoImpact(entity this)
 {
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
 void SUB_RemoveOnNoImpact(entity this)
 {
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
-               Gib_Delete(self);
+               Gib_Delete(this);
 }
 
 void Gib_Touch(entity this)
 }
 
 void Gib_Touch(entity this)
@@ -123,15 +123,15 @@ void Gib_Touch(entity this)
 
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        {
 
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        {
-               Gib_Delete(self);
+               Gib_Delete(this);
                return;
        }
 
                return;
        }
 
-       if(!self.silent)
-               sound(self, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM);
-       __pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
+       if(!this.silent)
+               sound(this, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM);
+       __pointparticles(_particleeffectnum(strcat(species_prefix(this.cnt), "blood")), this.origin + '0 0 1', '0 0 30', 10);
 
 
-       Gib_Delete(self);
+       Gib_Delete(this);
 }
 
 void Gib_Draw(entity this)
 }
 
 void Gib_Draw(entity this)
index 8a16a1dc3122c2d5d04507175328e52d5db25902..e7fea83db1fad32150422b73798b476cbb47d706 100644 (file)
@@ -28,8 +28,8 @@ REGISTER_NET_TEMP(TE_CSQC_ARC)
 
 void b_draw()
 {
 
 void b_draw()
 {
-    //Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE, view_origin);
-    Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, (self.fx_with/256), 0, '1 1 1', 1, DRAWFLAG_ADDITIVE, view_origin);
+    //Draw_CylindricLine(this.fx_start, this.fx_end, this.fx_with, this.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE, view_origin);
+    Draw_CylindricLine(this.fx_start, this.fx_end, this.fx_with, this.fx_texture, (this.fx_with/256), 0, '1 1 1', 1, DRAWFLAG_ADDITIVE, view_origin);
 
 }
 void b_make(vector s,vector e, string t,float l,float z)
 
 }
 void b_make(vector s,vector e, string t,float l,float z)
index d17ff7f1619a60ec227f6d30eafe7986fe17a1a5..5a4f7e3a045a1266057350d5cf487a9c2839f608 100644 (file)
@@ -293,46 +293,46 @@ void football_touch(entity this)
 {
        if(other.solid == SOLID_BSP)
        {
 {
        if(other.solid == SOLID_BSP)
        {
-               if(time > self.lastground + 0.1)
+               if(time > this.lastground + 0.1)
                {
                {
-                       _sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
-                       self.lastground = time;
+                       _sound(this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
+                       this.lastground = time;
                }
                }
-               if(vlen(self.velocity) && !self.cnt)
-                       self.nextthink = time + autocvar_g_nexball_delay_idle;
+               if(this.velocity && !this.cnt)
+                       this.nextthink = time + autocvar_g_nexball_delay_idle;
                return;
        }
        if (!IS_PLAYER(other))
                return;
        if(other.health < 1)
                return;
                return;
        }
        if (!IS_PLAYER(other))
                return;
        if(other.health < 1)
                return;
-       if(!self.cnt)
-               self.nextthink = time + autocvar_g_nexball_delay_idle;
+       if(!this.cnt)
+               this.nextthink = time + autocvar_g_nexball_delay_idle;
 
 
-       self.pusher = other;
-       self.team = other.team;
+       this.pusher = other;
+       this.team = other.team;
 
        if(autocvar_g_nexball_football_physics == -1)   // MrBougo try 1, before decompiling Rev's original
        {
                if(vlen(other.velocity))
 
        if(autocvar_g_nexball_football_physics == -1)   // MrBougo try 1, before decompiling Rev's original
        {
                if(vlen(other.velocity))
-                       self.velocity = other.velocity * 1.5 + '0 0 1' * autocvar_g_nexball_football_boost_up;
+                       this.velocity = other.velocity * 1.5 + '0 0 1' * autocvar_g_nexball_football_boost_up;
        }
        else if(autocvar_g_nexball_football_physics == 1)         // MrBougo's modded Rev style: partially independant of the height of the aiming point
        {
                makevectors(other.v_angle);
        }
        else if(autocvar_g_nexball_football_physics == 1)         // MrBougo's modded Rev style: partially independant of the height of the aiming point
        {
                makevectors(other.v_angle);
-               self.velocity = other.velocity + v_forward * autocvar_g_nexball_football_boost_forward + '0 0 1' * autocvar_g_nexball_football_boost_up;
+               this.velocity = other.velocity + v_forward * autocvar_g_nexball_football_boost_forward + '0 0 1' * autocvar_g_nexball_football_boost_up;
        }
        else if(autocvar_g_nexball_football_physics == 2)         // 2nd mod try: totally independant. Really playable!
        {
                makevectors(other.v_angle.y * '0 1 0');
        }
        else if(autocvar_g_nexball_football_physics == 2)         // 2nd mod try: totally independant. Really playable!
        {
                makevectors(other.v_angle.y * '0 1 0');
-               self.velocity = other.velocity + v_forward * autocvar_g_nexball_football_boost_forward + v_up * autocvar_g_nexball_football_boost_up;
+               this.velocity = other.velocity + v_forward * autocvar_g_nexball_football_boost_forward + v_up * autocvar_g_nexball_football_boost_up;
        }
        else     // Revenant's original style (from the original mod's disassembly, acknowledged by Revenant)
        {
                makevectors(other.v_angle);
        }
        else     // Revenant's original style (from the original mod's disassembly, acknowledged by Revenant)
        {
                makevectors(other.v_angle);
-               self.velocity = other.velocity + v_forward * autocvar_g_nexball_football_boost_forward + v_up * autocvar_g_nexball_football_boost_up;
+               this.velocity = other.velocity + v_forward * autocvar_g_nexball_football_boost_forward + v_up * autocvar_g_nexball_football_boost_up;
        }
        }
-       self.avelocity = -250 * v_forward;  // maybe there is a way to make it look better?
+       this.avelocity = -250 * v_forward;  // maybe there is a way to make it look better?
 }
 
 void basketball_touch(entity this)
 }
 
 void basketball_touch(entity this)
@@ -342,18 +342,18 @@ void basketball_touch(entity this)
                football_touch(this);
                return;
        }
                football_touch(this);
                return;
        }
-       if(!self.cnt && IS_PLAYER(other) && !STAT(FROZEN, other) && !IS_DEAD(other) && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
+       if(!this.cnt && IS_PLAYER(other) && !STAT(FROZEN, other) && !IS_DEAD(other) && (other != this.nb_dropper || time > this.nb_droptime + autocvar_g_nexball_delay_collect))
        {
                if(other.health <= 0)
                        return;
                LogNB("caught", other);
        {
                if(other.health <= 0)
                        return;
                LogNB("caught", other);
-               GiveBall(other, self);
+               GiveBall(other, this);
        }
        else if(other.solid == SOLID_BSP)
        {
        }
        else if(other.solid == SOLID_BSP)
        {
-               _sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
-               if(vlen(self.velocity) && !self.cnt)
-                       self.nextthink = min(time + autocvar_g_nexball_delay_idle, self.teamtime);
+               _sound(this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
+               if(vlen(this.velocity) && !this.cnt)
+                       this.nextthink = min(time + autocvar_g_nexball_delay_idle, this.teamtime);
        }
 }
 
        }
 }
 
@@ -364,14 +364,14 @@ void GoalTouch(entity this)
        string pname;
 
        if(gameover) return;
        string pname;
 
        if(gameover) return;
-       if((self.spawnflags & GOAL_TOUCHPLAYER) && other.ballcarried)
+       if((this.spawnflags & GOAL_TOUCHPLAYER) && other.ballcarried)
                ball = other.ballcarried;
        else
                ball = other;
        if(ball.classname != "nexball_basketball")
                if(ball.classname != "nexball_football")
                        return;
                ball = other.ballcarried;
        else
                ball = other;
        if(ball.classname != "nexball_basketball")
                if(ball.classname != "nexball_football")
                        return;
-       if((!ball.pusher && self.team != GOAL_OUT) || ball.cnt)
+       if((!ball.pusher && this.team != GOAL_OUT) || ball.cnt)
                return;
        EXACTTRIGGER_TOUCH;
 
                return;
        EXACTTRIGGER_TOUCH;
 
@@ -386,13 +386,13 @@ void GoalTouch(entity this)
        else
                pname = "Someone (?)";
 
        else
                pname = "Someone (?)";
 
-       if(ball.team == self.team)               //owngoal (regular goals)
+       if(ball.team == this.team)               //owngoal (regular goals)
        {
                LogNB("owngoal", ball.pusher);
                bprint("Boo! ", pname, "^7 scored a goal against their own team!\n");
                pscore = -1;
        }
        {
                LogNB("owngoal", ball.pusher);
                bprint("Boo! ", pname, "^7 scored a goal against their own team!\n");
                pscore = -1;
        }
-       else if(self.team == GOAL_FAULT)
+       else if(this.team == GOAL_FAULT)
        {
                LogNB("fault", ball.pusher);
                if(nb_teams == 2)
        {
                LogNB("fault", ball.pusher);
                if(nb_teams == 2)
@@ -401,10 +401,10 @@ void GoalTouch(entity this)
                        bprint(Team_ColoredFullName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
                pscore = -1;
        }
                        bprint(Team_ColoredFullName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
                pscore = -1;
        }
-       else if(self.team == GOAL_OUT)
+       else if(this.team == GOAL_OUT)
        {
                LogNB("out", ball.pusher);
        {
                LogNB("out", ball.pusher);
-               if((self.spawnflags & GOAL_TOUCHPLAYER) && ball.owner)
+               if((this.spawnflags & GOAL_TOUCHPLAYER) && ball.owner)
                        bprint(pname, "^7 went out of bounds.\n");
                else
                        bprint("The ball was returned.\n");
                        bprint(pname, "^7 went out of bounds.\n");
                else
                        bprint("The ball was returned.\n");
@@ -412,12 +412,12 @@ void GoalTouch(entity this)
        }
        else                                                       //score
        {
        }
        else                                                       //score
        {
-               LogNB(strcat("goal:", ftos(self.team)), ball.pusher);
+               LogNB(strcat("goal:", ftos(this.team)), ball.pusher);
                bprint("Goaaaaal! ", pname, "^7 scored a point for the ", Team_ColoredFullName(ball.team), ".\n");
                pscore = 1;
        }
 
                bprint("Goaaaaal! ", pname, "^7 scored a point for the ", Team_ColoredFullName(ball.team), ".\n");
                pscore = 1;
        }
 
-       _sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NONE);
+       _sound(ball, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NONE);
 
        if(ball.team && pscore)
        {
 
        if(ball.team && pscore)
        {
@@ -443,7 +443,7 @@ void GoalTouch(entity this)
        setthink(ball, ResetBall);
        if(ball.classname == "nexball_basketball")
                settouch(ball, football_touch); // better than func_null: football control until the ball gets reset
        setthink(ball, ResetBall);
        if(ball.classname == "nexball_basketball")
                settouch(ball, football_touch); // better than func_null: football control until the ball gets reset
-       ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT);
+       ball.nextthink = time + autocvar_g_nexball_delay_goal * (this.team != GOAL_OUT);
 }
 
 //=======================//
 }
 
 //=======================//
@@ -613,7 +613,7 @@ float nb_Goal_Customize(entity this)
 {
        entity e, wp_owner;
        e = WaypointSprite_getviewentity(other);
 {
        entity e, wp_owner;
        e = WaypointSprite_getviewentity(other);
-       wp_owner = self.owner;
+       wp_owner = this.owner;
        if(SAME_TEAM(e, wp_owner)) { return false; }
 
        return true;
        if(SAME_TEAM(e, wp_owner)) { return false; }
 
        return true;
@@ -840,26 +840,26 @@ void W_Nexball_Attack2(entity actor)
 
 float ball_customize(entity this)
 {
 
 float ball_customize(entity this)
 {
-       if(!self.owner)
+       if(!this.owner)
        {
        {
-               self.effects &= ~EF_FLAME;
-               self.scale = 1;
-               setcefc(self, func_null);
+               this.effects &= ~EF_FLAME;
+               this.scale = 1;
+               setcefc(this, func_null);
                return true;
        }
 
                return true;
        }
 
-       if(other == self.owner)
+       if(other == this.owner)
        {
        {
-               self.scale = autocvar_g_nexball_viewmodel_scale;
-               if(self.enemy)
-                       self.effects |= EF_FLAME;
+               this.scale = autocvar_g_nexball_viewmodel_scale;
+               if(this.enemy)
+                       this.effects |= EF_FLAME;
                else
                else
-                       self.effects &= ~EF_FLAME;
+                       this.effects &= ~EF_FLAME;
        }
        else
        {
        }
        else
        {
-               self.effects &= ~EF_FLAME;
-               self.scale = 1;
+               this.effects &= ~EF_FLAME;
+               this.scale = 1;
        }
 
        return true;
        }
 
        return true;
index 005bd09216101761067eb34a042563f3c5365399..ce31eecedc893a721c7bdf0f6ffc9687b8317208 100644 (file)
@@ -166,28 +166,28 @@ bool ons_CaptureShield_Customize(entity this)
 {
        entity e = WaypointSprite_getviewentity(other);
 
 {
        entity e = WaypointSprite_getviewentity(other);
 
-       if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, e.team) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return false; }
-       if(SAME_TEAM(self, e)) { return false; }
+       if(!this.enemy.isshielded && (ons_ControlPoint_Attackable(this.enemy, e.team) > 0 || this.enemy.classname != "onslaught_controlpoint")) { return false; }
+       if(SAME_TEAM(this, e)) { return false; }
 
        return true;
 }
 
 void ons_CaptureShield_Touch(entity this)
 {
 
        return true;
 }
 
 void ons_CaptureShield_Touch(entity this)
 {
-       if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, other.team) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return; }
+       if(!this.enemy.isshielded && (ons_ControlPoint_Attackable(this.enemy, other.team) > 0 || this.enemy.classname != "onslaught_controlpoint")) { return; }
        if(!IS_PLAYER(other)) { return; }
        if(!IS_PLAYER(other)) { return; }
-       if(SAME_TEAM(other, self)) { return; }
+       if(SAME_TEAM(other, this)) { return; }
 
 
-       vector mymid = (self.absmin + self.absmax) * 0.5;
+       vector mymid = (this.absmin + this.absmax) * 0.5;
        vector othermid = (other.absmin + other.absmax) * 0.5;
 
        vector othermid = (other.absmin + other.absmax) * 0.5;
 
-       Damage(other, self, self, 0, DEATH_HURTTRIGGER.m_id, mymid, normalize(othermid - mymid) * ons_captureshield_force);
+       Damage(other, this, this, 0, DEATH_HURTTRIGGER.m_id, mymid, normalize(othermid - mymid) * ons_captureshield_force);
 
        if(IS_REAL_CLIENT(other))
        {
                play2(other, SND(ONS_DAMAGEBLOCKEDBYSHIELD));
 
 
        if(IS_REAL_CLIENT(other))
        {
                play2(other, SND(ONS_DAMAGEBLOCKEDBYSHIELD));
 
-               if(self.enemy.classname == "onslaught_generator")
+               if(this.enemy.classname == "onslaught_generator")
                        Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_ONS_GENERATOR_SHIELDED);
                else
                        Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_ONS_CONTROLPOINT_SHIELDED);
                        Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_ONS_GENERATOR_SHIELDED);
                else
                        Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_ONS_CONTROLPOINT_SHIELDED);
@@ -378,19 +378,19 @@ bool ons_Link_Send(entity this, entity to, int sendflags)
        WriteByte(MSG_ENTITY, sendflags);
        if(sendflags & 1)
        {
        WriteByte(MSG_ENTITY, sendflags);
        if(sendflags & 1)
        {
-               WriteCoord(MSG_ENTITY, self.goalentity.origin_x);
-               WriteCoord(MSG_ENTITY, self.goalentity.origin_y);
-               WriteCoord(MSG_ENTITY, self.goalentity.origin_z);
+               WriteCoord(MSG_ENTITY, this.goalentity.origin_x);
+               WriteCoord(MSG_ENTITY, this.goalentity.origin_y);
+               WriteCoord(MSG_ENTITY, this.goalentity.origin_z);
        }
        if(sendflags & 2)
        {
        }
        if(sendflags & 2)
        {
-               WriteCoord(MSG_ENTITY, self.enemy.origin_x);
-               WriteCoord(MSG_ENTITY, self.enemy.origin_y);
-               WriteCoord(MSG_ENTITY, self.enemy.origin_z);
+               WriteCoord(MSG_ENTITY, this.enemy.origin_x);
+               WriteCoord(MSG_ENTITY, this.enemy.origin_y);
+               WriteCoord(MSG_ENTITY, this.enemy.origin_z);
        }
        if(sendflags & 4)
        {
        }
        if(sendflags & 4)
        {
-               WriteByte(MSG_ENTITY, self.clientcolors); // which is goalentity's color + enemy's color * 16
+               WriteByte(MSG_ENTITY, this.clientcolors); // which is goalentity's color + enemy's color * 16
        }
        return true;
 }
        }
        return true;
 }
@@ -791,8 +791,8 @@ void ons_ControlPoint_Touch(entity this)
        if(STAT(FROZEN, toucher)) { return; }
        if(IS_DEAD(toucher)) { return; }
 
        if(STAT(FROZEN, toucher)) { return; }
        if(IS_DEAD(toucher)) { return; }
 
-       if ( SAME_TEAM(self,toucher) )
-       if ( self.iscaptured )
+       if ( SAME_TEAM(this,toucher) )
+       if ( this.iscaptured )
        {
                if(time <= toucher.teleport_antispam)
                        Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_ONS_TELEPORT_ANTISPAM, rint(toucher.teleport_antispam - time));
        {
                if(time <= toucher.teleport_antispam)
                        Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_ONS_TELEPORT_ANTISPAM, rint(toucher.teleport_antispam - time));
@@ -800,23 +800,23 @@ void ons_ControlPoint_Touch(entity this)
                        Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_ONS_TELEPORT);
        }
 
                        Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_ONS_TELEPORT);
        }
 
-       attackable = ons_ControlPoint_Attackable(self, toucher.team);
+       attackable = ons_ControlPoint_Attackable(this, toucher.team);
        if(attackable != 2 && attackable != 4)
                return;
        // we've verified that this player has a legitimate claim to this point,
        // so start building the captured point icon (which only captures this
        // point if it successfully builds without being destroyed first)
        if(attackable != 2 && attackable != 4)
                return;
        // we've verified that this player has a legitimate claim to this point,
        // so start building the captured point icon (which only captures this
        // point if it successfully builds without being destroyed first)
-       ons_ControlPoint_Icon_Spawn(self, toucher);
+       ons_ControlPoint_Icon_Spawn(this, toucher);
 
 
-       self.ons_toucher = toucher;
+       this.ons_toucher = toucher;
 
        onslaught_updatelinks();
 }
 
 void ons_ControlPoint_Think(entity this)
 {
 
        onslaught_updatelinks();
 }
 
 void ons_ControlPoint_Think(entity this)
 {
-       self.nextthink = time + ONS_CP_THINKRATE;
-       CSQCMODEL_AUTOUPDATE(self);
+       this.nextthink = time + ONS_CP_THINKRATE;
+       CSQCMODEL_AUTOUPDATE(this);
 }
 
 void ons_ControlPoint_Reset(entity this)
 }
 
 void ons_ControlPoint_Reset(entity this)
@@ -1070,24 +1070,24 @@ void ons_GeneratorReset(entity this)
 void ons_DelayedGeneratorSetup(entity this)
 {
        // bot waypoints
 void ons_DelayedGeneratorSetup(entity this)
 {
        // bot waypoints
-       waypoint_spawnforitem_force(self, self.origin);
-       self.nearestwaypointtimeout = 0; // activate waypointing again
-       self.bot_basewaypoint = self.nearestwaypoint;
+       waypoint_spawnforitem_force(this, this.origin);
+       this.nearestwaypointtimeout = 0; // activate waypointing again
+       this.bot_basewaypoint = this.nearestwaypoint;
 
        // captureshield setup
 
        // captureshield setup
-       ons_CaptureShield_Spawn(self, true);
+       ons_CaptureShield_Spawn(this, true);
 
        onslaught_updatelinks();
 
 
        onslaught_updatelinks();
 
-       Net_LinkEntity(self, false, 0, generator_send);
+       Net_LinkEntity(this, false, 0, generator_send);
 }
 
 
 void onslaught_generator_touch(entity this)
 {
        if ( IS_PLAYER(other) )
 }
 
 
 void onslaught_generator_touch(entity this)
 {
        if ( IS_PLAYER(other) )
-       if ( SAME_TEAM(self,other) )
-       if ( self.iscaptured )
+       if ( SAME_TEAM(this,other) )
+       if ( this.iscaptured )
        {
                Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_ONS_TELEPORT);
        }
        {
                Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_ONS_TELEPORT);
        }
index aceb3e64eacf9f504a2002d1b47dbde0dbb147cc..491acdd007d8635cac7417c2bd5acdc11c6cff95 100644 (file)
@@ -8,25 +8,25 @@ bool cpicon_send(entity this, entity to, int sf)
        WriteByte(MSG_ENTITY, sf);
        if(sf & CPSF_SETUP)
        {
        WriteByte(MSG_ENTITY, sf);
        if(sf & CPSF_SETUP)
        {
-               WriteCoord(MSG_ENTITY, self.origin_x);
-               WriteCoord(MSG_ENTITY, self.origin_y);
-               WriteCoord(MSG_ENTITY, self.origin_z);
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
 
 
-               WriteByte(MSG_ENTITY, self.health);
-               WriteByte(MSG_ENTITY, self.max_health);
-               WriteByte(MSG_ENTITY, self.count);
-               WriteByte(MSG_ENTITY, self.team);
-               WriteByte(MSG_ENTITY, self.owner.iscaptured);
+               WriteByte(MSG_ENTITY, this.health);
+               WriteByte(MSG_ENTITY, this.max_health);
+               WriteByte(MSG_ENTITY, this.count);
+               WriteByte(MSG_ENTITY, this.team);
+               WriteByte(MSG_ENTITY, this.owner.iscaptured);
        }
 
        if(sf & CPSF_STATUS)
        {
        }
 
        if(sf & CPSF_STATUS)
        {
-               WriteByte(MSG_ENTITY, self.team);
+               WriteByte(MSG_ENTITY, this.team);
 
 
-               if(self.health <= 0)
+               if(this.health <= 0)
                        WriteByte(MSG_ENTITY, 0);
                else
                        WriteByte(MSG_ENTITY, 0);
                else
-                       WriteByte(MSG_ENTITY, ceil((self.health / self.max_health) * 255));
+                       WriteByte(MSG_ENTITY, ceil((this.health / this.max_health) * 255));
        }
 
        return true;
        }
 
        return true;
index 1c85489c0aeded4379d64e97f3ba293f999d117e..6fc2400d35a2b8cfee470bea46dbe98c669a3d3b 100644 (file)
@@ -265,7 +265,7 @@ void HUD_MinigameMenu_ClickJoin(entity this, entity actor, entity trigger)
 /*// Temporary placeholder for un-implemented Click actions
 void HUD_MinigameMenu_ClickNoop()
 {
 /*// Temporary placeholder for un-implemented Click actions
 void HUD_MinigameMenu_ClickNoop()
 {
-       dprint("Placeholder for ",self.message,"\n");
+       dprint("Placeholder for ",this.message,"\n");
 }*/
 
 // Click action for Quit
 }*/
 
 // Click action for Quit
@@ -287,7 +287,7 @@ void HUD_MinigameMenu_ClickInvite(entity this, entity actor, entity trigger)
        if ( HUD_MinigameMenu_Click_ExpandCollapse(this) )
        {
                entity e;
        if ( HUD_MinigameMenu_Click_ExpandCollapse(this) )
        {
                entity e;
-               entity prev = self;
+               entity prev = this;
                for(int i = 0; i < maxclients; ++i)
                {
                        if ( player_localnum != i && playerslots[i] && entcs_GetName(i) != "" &&
                for(int i = 0; i < maxclients; ++i)
                {
                        if ( player_localnum != i && playerslots[i] && entcs_GetName(i) != "" &&
@@ -295,7 +295,7 @@ void HUD_MinigameMenu_ClickInvite(entity this, entity actor, entity trigger)
                        {
                                e = HUD_MinigameMenu_SpawnSubEntry(
                                        strzone(entcs_GetName(i)), HUD_MinigameMenu_ClickInvite_Entry,
                        {
                                e = HUD_MinigameMenu_SpawnSubEntry(
                                        strzone(entcs_GetName(i)), HUD_MinigameMenu_ClickInvite_Entry,
-                                       self );
+                                       this );
                                e.flags |= 1;
                                e.netname = strzone(ftos(i+1));
                                e.origin_x *= 2;
                                e.flags |= 1;
                                e.netname = strzone(ftos(i+1));
                                e.origin_x *= 2;
index 4bcb8c51446ee77020731131ee95bc2e9bc7ef9e..ef3c700859cdf87801896954abd627b5a00eb1e6 100644 (file)
@@ -56,7 +56,7 @@ void pong_ball_throw(entity ball)
 // Think equivalent of pong_ball_throw, used to delay throws
 void pong_ball_throwthink(entity this)
 {
 // Think equivalent of pong_ball_throw, used to delay throws
 void pong_ball_throwthink(entity this)
 {
-       pong_ball_throw(self);
+       pong_ball_throw(this);
 }
 
 // Moves ball to the center and stops its motion
 }
 
 // Moves ball to the center and stops its motion
index 50dc93010642df60d52e3a9475a20847379ee404..b9a7b78cf86b53894e4a452f25815cc82bd3e365 100644 (file)
@@ -50,10 +50,10 @@ void minigame_rmplayer(entity minigame_session, entity player)
 }
 
 
 }
 
 
-#define FIELD(Flags, Type,Name) if ( sf & (Flags) ) Write##Type(MSG_ENTITY, self.Name);
+#define FIELD(Flags, Type,Name) if ( sf & (Flags) ) Write##Type(MSG_ENTITY, this.Name);
 #define MSLE(Name,Fields) \
 #define MSLE(Name,Fields) \
-       else if ( self.classname == #Name ) { \
-               if ( sf & MINIG_SF_CREATE ) WriteString(MSG_ENTITY,self.owner.netname); \
+       else if ( this.classname == #Name ) { \
+               if ( sf & MINIG_SF_CREATE ) WriteString(MSG_ENTITY,this.owner.netname); \
                Fields }
 
 // Send an entity to a client
                Fields }
 
 // Send an entity to a client
@@ -115,7 +115,7 @@ void minigame_resend(entity minigame)
 bool minigame_CheckSend(entity this)
 {
        entity e;
 bool minigame_CheckSend(entity this)
 {
        entity e;
-       for ( e = self.owner.minigame_players; e != world; e = e.list_next )
+       for ( e = this.owner.minigame_players; e != world; e = e.list_next )
                if ( e.minigame_players == other )
                        return true;
        return false;
                if ( e.minigame_players == other )
                        return true;
        return false;
index 2401c9011a4eabaa25d9a0ac2eb4d7f9ca453889..247c6b8f4efbaf22d447e7f608a72ec5adc90b62 100644 (file)
@@ -164,7 +164,7 @@ void M_Mage_Attack_Spike_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
 
 {
        PROJECTILE_TOUCH(this);
 
-       M_Mage_Attack_Spike_Explode(self);
+       M_Mage_Attack_Spike_Explode(this);
 }
 
 .float wait;
 }
 
 .float wait;
index e98c372c2c041cf9b1a8265e3ec1c0666da030fc..0d134941b464d80755a38a0faf46402ace06ed71 100644 (file)
@@ -128,7 +128,7 @@ void M_Shambler_Attack_Lightning_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
 
 {
        PROJECTILE_TOUCH(this);
 
-       self.use(this, NULL, NULL);
+       this.use(this, NULL, NULL);
 }
 
 void M_Shambler_Attack_Lightning_Think(entity this)
 }
 
 void M_Shambler_Attack_Lightning_Think(entity this)
index 578cf4c59cf57628d28a7d9e5a4795e74e1f0edd..1eafd4bfd103897ef3993192221ec9a1f9c12237 100644 (file)
@@ -77,24 +77,24 @@ const float zombie_anim_spawn                               = 30;
 
 void M_Zombie_Attack_Leap_Touch(entity this)
 {
 
 void M_Zombie_Attack_Leap_Touch(entity this)
 {
-       if (self.health <= 0)
+       if (this.health <= 0)
                return;
 
        vector angles_face;
 
        if(other.takedamage)
        {
                return;
 
        vector angles_face;
 
        if(other.takedamage)
        {
-               angles_face = vectoangles(self.moveto - self.origin);
+               angles_face = vectoangles(this.moveto - this.origin);
                angles_face = normalize(angles_face) * (autocvar_g_monster_zombie_attack_leap_force);
                angles_face = normalize(angles_face) * (autocvar_g_monster_zombie_attack_leap_force);
-               Damage(other, self, self, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_ZOMBIE_JUMP.m_id, other.origin, angles_face);
-               settouch(self, Monster_Touch); // instantly turn it off to stop damage spam
-               self.state = 0;
+               Damage(other, this, this, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(this), DEATH_MONSTER_ZOMBIE_JUMP.m_id, other.origin, angles_face);
+               settouch(this, Monster_Touch); // instantly turn it off to stop damage spam
+               this.state = 0;
        }
 
        if (trace_dphitcontents)
        {
        }
 
        if (trace_dphitcontents)
        {
-               self.state = 0;
-               settouch(self, Monster_Touch);
+               this.state = 0;
+               settouch(this, Monster_Touch);
        }
 }
 
        }
 }
 
index 87046b96e4df075cb74d51f97d3b0a9fa9f9d6f4..e2cb8b3181d3e8783939f46bd99e2b7f6169b653 100644 (file)
@@ -98,25 +98,25 @@ bool buffs_BuffModel_Customize(entity this)
        bool same_team;
 
        player = WaypointSprite_getviewentity(other);
        bool same_team;
 
        player = WaypointSprite_getviewentity(other);
-       myowner = self.owner;
+       myowner = this.owner;
        same_team = (SAME_TEAM(player, myowner) || SAME_TEAM(player, myowner));
 
        if(myowner.alpha <= 0.5 && !same_team && myowner.alpha != 0)
                return false;
 
        same_team = (SAME_TEAM(player, myowner) || SAME_TEAM(player, myowner));
 
        if(myowner.alpha <= 0.5 && !same_team && myowner.alpha != 0)
                return false;
 
-       if(MUTATOR_CALLHOOK(BuffModel_Customize, self, player))
+       if(MUTATOR_CALLHOOK(BuffModel_Customize, this, player))
                return false;
 
        if(player == myowner || (IS_SPEC(other) && other.enemy == myowner))
        {
                // somewhat hide the model, but keep the glow
                return false;
 
        if(player == myowner || (IS_SPEC(other) && other.enemy == myowner))
        {
                // somewhat hide the model, but keep the glow
-               self.effects = 0;
-               self.alpha = -1;
+               this.effects = 0;
+               this.alpha = -1;
        }
        else
        {
        }
        else
        {
-               self.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
-               self.alpha = 1;
+               this.effects = EF_FULLBRIGHT | EF_LOWPRECISION;
+               this.alpha = 1;
        }
        return true;
 }
        }
        return true;
 }
@@ -228,21 +228,21 @@ void buff_Touch(entity this)
 
        if(ITEM_TOUCH_NEEDKILL())
        {
 
        if(ITEM_TOUCH_NEEDKILL())
        {
-               buff_Respawn(self);
+               buff_Respawn(this);
                return;
        }
 
                return;
        }
 
-       if((self.team && DIFF_TEAM(other, self))
+       if((this.team && DIFF_TEAM(other, this))
        || (STAT(FROZEN, other))
        || (other.vehicle)
        || (STAT(FROZEN, other))
        || (other.vehicle)
-       || (!self.buff_active)
+       || (!this.buff_active)
        )
        {
                // can't touch this
                return;
        }
 
        )
        {
                // can't touch this
                return;
        }
 
-       if(MUTATOR_CALLHOOK(BuffTouch, self, other))
+       if(MUTATOR_CALLHOOK(BuffTouch, this, other))
                return;
 
        if(!IS_PLAYER(other))
                return;
 
        if(!IS_PLAYER(other))
@@ -250,7 +250,7 @@ void buff_Touch(entity this)
 
        if (other.buffs)
        {
 
        if (other.buffs)
        {
-               if (other.cvar_cl_buffs_autoreplace && other.buffs != self.buffs)
+               if (other.cvar_cl_buffs_autoreplace && other.buffs != this.buffs)
                {
                        int buffid = buff_FirstFromFlags(other.buffs).m_id;
                        //Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_DROP, other.buffs);
                {
                        int buffid = buff_FirstFromFlags(other.buffs).m_id;
                        //Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_DROP, other.buffs);
@@ -262,16 +262,16 @@ void buff_Touch(entity this)
                else { return; } // do nothing
        }
 
                else { return; } // do nothing
        }
 
-       self.owner = other;
-       self.buff_active = false;
-       self.lifetime = 0;
-       int buffid = buff_FirstFromFlags(self.buffs).m_id;
+       this.owner = other;
+       this.buff_active = false;
+       this.lifetime = 0;
+       int buffid = buff_FirstFromFlags(this.buffs).m_id;
        Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, buffid);
        Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid);
 
        Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, buffid);
        Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid);
 
-       Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+       Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
        sound(other, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTN_NORM);
        sound(other, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTN_NORM);
-       other.buffs |= (self.buffs);
+       other.buffs |= (this.buffs);
 }
 
 float buff_Available(entity buff)
 }
 
 float buff_Available(entity buff)
@@ -1036,14 +1036,14 @@ MUTATOR_HOOKFUNCTION(buffs, VehicleExit)
 
 MUTATOR_HOOKFUNCTION(buffs, PlayerRegen)
 {SELFPARAM();
 
 MUTATOR_HOOKFUNCTION(buffs, PlayerRegen)
 {SELFPARAM();
-       if(self.buffs & BUFF_MEDIC.m_itemid)
+       if(this.buffs & BUFF_MEDIC.m_itemid)
        {
                regen_mod_rot = autocvar_g_buffs_medic_rot;
                regen_mod_limit = regen_mod_max = autocvar_g_buffs_medic_max;
                regen_mod_regen = autocvar_g_buffs_medic_regen;
        }
 
        {
                regen_mod_rot = autocvar_g_buffs_medic_rot;
                regen_mod_limit = regen_mod_max = autocvar_g_buffs_medic_max;
                regen_mod_regen = autocvar_g_buffs_medic_regen;
        }
 
-       if(self.buffs & BUFF_SPEED.m_itemid)
+       if(this.buffs & BUFF_SPEED.m_itemid)
                regen_mod_regen = autocvar_g_buffs_speed_regen;
 }
 
                regen_mod_regen = autocvar_g_buffs_speed_regen;
 }
 
index cfc89b057645e96f060b54b30cb2349c32801a4e..9c1f4bc7ad7cf68842d98d9e929052bf29adb604 100644 (file)
@@ -122,7 +122,7 @@ void NIX_GiveCurrentWeapon(entity this)
        // get weapon info
        entity e = Weapons_from(nix_weapon);
 
        // get weapon info
        entity e = Weapons_from(nix_weapon);
 
-       if(nix_nextchange != self.nix_lastchange_id) // this shall only be called once per round!
+       if(nix_nextchange != this.nix_lastchange_id) // this shall only be called once per round!
        {
                this.ammo_shells = this.ammo_nails = this.ammo_rockets = this.ammo_cells = this.ammo_plasma = this.ammo_fuel = 0;
 
        {
                this.ammo_shells = this.ammo_nails = this.ammo_rockets = this.ammo_cells = this.ammo_plasma = this.ammo_fuel = 0;
 
index 19e88cd6387ce6d863a160868a1b393e372714af..a25dbe3e7829fa5f59e41c50643a8322bbf48b29 100644 (file)
@@ -167,10 +167,10 @@ MUTATOR_HOOKFUNCTION(ok, MonsterDropItem)
 MUTATOR_HOOKFUNCTION(ok, PlayerRegen)
 {SELFPARAM();
        // overkill's values are different, so use custom regen
 MUTATOR_HOOKFUNCTION(ok, PlayerRegen)
 {SELFPARAM();
        // overkill's values are different, so use custom regen
-       if(!STAT(FROZEN, self))
+       if(!STAT(FROZEN, this))
        {
        {
-               self.armorvalue = CalcRotRegen(self.armorvalue, autocvar_g_balance_armor_regenstable, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, 1 * frametime * (time > self.ok_pauseregen_finished), 0, 0, 1, 1 * frametime * (time > self.pauserotarmor_finished), autocvar_g_balance_armor_limit);
-               self.health = CalcRotRegen(self.health, autocvar_g_balance_health_regenstable, 0, 100, 1 * frametime * (time > self.ok_pauseregen_finished), 200, 0, autocvar_g_balance_health_rotlinear, 1 * frametime * (time > self.pauserothealth_finished), autocvar_g_balance_health_limit);
+               this.armorvalue = CalcRotRegen(this.armorvalue, autocvar_g_balance_armor_regenstable, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, 1 * frametime * (time > this.ok_pauseregen_finished), 0, 0, 1, 1 * frametime * (time > this.pauserotarmor_finished), autocvar_g_balance_armor_limit);
+               this.health = CalcRotRegen(this.health, autocvar_g_balance_health_regenstable, 0, 100, 1 * frametime * (time > this.ok_pauseregen_finished), 200, 0, autocvar_g_balance_health_rotlinear, 1 * frametime * (time > this.pauserothealth_finished), autocvar_g_balance_health_limit);
 
                float minf, maxf, limitf;
 
 
                float minf, maxf, limitf;
 
@@ -178,7 +178,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerRegen)
                minf = autocvar_g_balance_fuel_regenstable;
                limitf = autocvar_g_balance_fuel_limit;
 
                minf = autocvar_g_balance_fuel_regenstable;
                limitf = autocvar_g_balance_fuel_limit;
 
-               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
+               this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
        }
        return true; // return true anyway, as frozen uses no regen
 }
        }
        return true; // return true anyway, as frozen uses no regen
 }
index e5831a1bd10612ff77b0ad35871b45804c6e4623..3fc2683c89e15480e8ae568af24776d825a5b231 100644 (file)
@@ -52,12 +52,12 @@ spawnfunc(weapon_rpc) { weapon_defaultspawnfunc(this, WEP_RPC); }
 
 void W_RocketPropelledChainsaw_Explode(entity this)
 {
 
 void W_RocketPropelledChainsaw_Explode(entity this)
 {
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
 
-       RadiusDamage (self, self.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), world, world, WEP_CVAR(rpc, force), self.projectiledeathtype, other);
+       RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), world, world, WEP_CVAR(rpc, force), this.projectiledeathtype, other);
 
 
-       remove (self);
+       remove (this);
 }
 
 void W_RocketPropelledChainsaw_Touch (entity this)
 }
 
 void W_RocketPropelledChainsaw_Touch (entity this)
@@ -85,29 +85,29 @@ void W_RocketPropelledChainsaw_Damage(entity this, entity inflictor, entity atta
 
 void W_RocketPropelledChainsaw_Think(entity this)
 {
 
 void W_RocketPropelledChainsaw_Think(entity this)
 {
-       if(self.cnt <= time)
+       if(this.cnt <= time)
        {
        {
-               remove(self);
+               remove(this);
                return;
        }
 
                return;
        }
 
-       self.cnt = vlen(self.velocity);
-       self.wait = self.cnt * sys_frametime;
-       self.pos1 = normalize(self.velocity);
+       this.cnt = vlen(this.velocity);
+       this.wait = this.cnt * sys_frametime;
+       this.pos1 = normalize(this.velocity);
 
 
-       tracebox(self.origin, self.mins, self.maxs, self.origin + self.pos1 * (2 * self.wait), MOVE_NORMAL, self);
+       tracebox(this.origin, this.mins, this.maxs, this.origin + this.pos1 * (2 * this.wait), MOVE_NORMAL, this);
        if(IS_PLAYER(trace_ent))
        if(IS_PLAYER(trace_ent))
-               Damage (trace_ent, self, self.realowner, WEP_CVAR(rpc, damage2), self.projectiledeathtype, self.origin, normalize(self.origin - other.origin) * WEP_CVAR(rpc, force));
+               Damage (trace_ent, this, this.realowner, WEP_CVAR(rpc, damage2), this.projectiledeathtype, this.origin, normalize(this.origin - other.origin) * WEP_CVAR(rpc, force));
 
 
-       self.velocity = self.pos1 * (self.cnt + (WEP_CVAR(rpc, speedaccel) * sys_frametime));
+       this.velocity = this.pos1 * (this.cnt + (WEP_CVAR(rpc, speedaccel) * sys_frametime));
 
 
-       UpdateCSQCProjectile(self);
-       self.nextthink = time;
+       UpdateCSQCProjectile(this);
+       this.nextthink = time;
 }
 
 void W_RocketPropelledChainsaw_Attack (Weapon thiswep, entity actor)
 {
 }
 
 void W_RocketPropelledChainsaw_Attack (Weapon thiswep, entity actor)
 {
-       entity missile = spawn(); //WarpZone_RefSys_SpawnSameRefSys(self);
+       entity missile = spawn(); //WarpZone_RefSys_SpawnSameRefSys(actor);
        entity flash = spawn ();
 
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(rpc, ammo));
        entity flash = spawn ();
 
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(rpc, ammo));
@@ -152,8 +152,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep, entity actor)
 
 METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
 }
 
 METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 }
 
 METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
@@ -219,12 +218,11 @@ METHOD(RocketPropelledChainsaw, wr_killmessage, Notification(entity thiswep))
 
 METHOD(RocketPropelledChainsaw, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(RocketPropelledChainsaw, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+        sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
 }
 
 #endif
 }
 
 #endif
index aad331527335362cc2d48c5b04a1c801fc51eb9e..fed70ef7d11a30feafe6ae3e866c9e9cfcf20b5a 100644 (file)
@@ -33,48 +33,48 @@ REGISTER_MUTATOR(physical_items, cvar("g_physical_items"))
 
 void physical_item_think(entity this)
 {
 
 void physical_item_think(entity this)
 {
-       self.nextthink = time;
+       this.nextthink = time;
 
 
-       self.alpha = self.owner.alpha; // apply fading and ghosting
+       this.alpha = this.owner.alpha; // apply fading and ghosting
 
 
-       if(!self.cnt) // map item, not dropped
+       if(!this.cnt) // map item, not dropped
        {
                // copy ghost item properties
        {
                // copy ghost item properties
-               self.colormap = self.owner.colormap;
-               self.colormod = self.owner.colormod;
-               self.glowmod = self.owner.glowmod;
+               this.colormap = this.owner.colormap;
+               this.colormod = this.owner.colormod;
+               this.glowmod = this.owner.glowmod;
 
                // if the item is not spawned, make sure the invisible / ghost item returns to its origin and stays there
                if(autocvar_g_physical_items_reset)
                {
 
                // if the item is not spawned, make sure the invisible / ghost item returns to its origin and stays there
                if(autocvar_g_physical_items_reset)
                {
-                       if(self.owner.wait > time) // awaiting respawn
+                       if(this.owner.wait > time) // awaiting respawn
                        {
                        {
-                               setorigin(self, self.spawn_origin);
-                               self.angles = self.spawn_angles;
-                               self.solid = SOLID_NOT;
-                               self.alpha = -1;
-                               self.movetype = MOVETYPE_NONE;
+                               setorigin(this, this.spawn_origin);
+                               this.angles = this.spawn_angles;
+                               this.solid = SOLID_NOT;
+                               this.alpha = -1;
+                               this.movetype = MOVETYPE_NONE;
                        }
                        else
                        {
                        }
                        else
                        {
-                               self.alpha = 1;
-                               self.solid = SOLID_CORPSE;
-                               self.movetype = MOVETYPE_PHYSICS;
+                               this.alpha = 1;
+                               this.solid = SOLID_CORPSE;
+                               this.movetype = MOVETYPE_PHYSICS;
                        }
                }
        }
 
                        }
                }
        }
 
-       if(!self.owner.modelindex)
-               remove(self); // the real item is gone, remove this
+       if(!this.owner.modelindex)
+               remove(this); // the real item is gone, remove this
 }
 
 void physical_item_touch(entity this)
 {
 }
 
 void physical_item_touch(entity this)
 {
-       if(!self.cnt) // not for dropped items
+       if(!this.cnt) // not for dropped items
        if (ITEM_TOUCH_NEEDKILL())
        {
        if (ITEM_TOUCH_NEEDKILL())
        {
-               setorigin(self, self.spawn_origin);
-               self.angles = self.spawn_angles;
+               setorigin(this, this.spawn_origin);
+               this.angles = this.spawn_angles;
        }
 }
 
        }
 }
 
index 62b3fb0bc9484cc7117f17c8104df0112312de61..56d0fb34e4d10da7b2e283f416290ef08d5f84e7 100644 (file)
@@ -48,15 +48,15 @@ void sandbox_ObjectFunction_Touch(entity this)
 {
        // apply material impact effects
 
 {
        // apply material impact effects
 
-       if(!self.material)
+       if(!this.material)
                return;
                return;
-       if(self.touch_timer > time)
+       if(this.touch_timer > time)
                return; // don't execute each frame
                return; // don't execute each frame
-       self.touch_timer = time + 0.1;
+       this.touch_timer = time + 0.1;
 
        // make particle count and sound volume depend on impact speed
        float intensity;
 
        // make particle count and sound volume depend on impact speed
        float intensity;
-       intensity = vlen(self.velocity) + vlen(other.velocity);
+       intensity = vlen(this.velocity) + vlen(other.velocity);
        if(intensity) // avoid divisions by 0
                intensity /= 2; // average the two velocities
        if (!(intensity >= autocvar_g_sandbox_object_material_velocity_min))
        if(intensity) // avoid divisions by 0
                intensity /= 2; // average the two velocities
        if (!(intensity >= autocvar_g_sandbox_object_material_velocity_min))
@@ -65,8 +65,8 @@ void sandbox_ObjectFunction_Touch(entity this)
        intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
        intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1);
 
        intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
        intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1);
 
-       _sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTEN_NORM);
-       Send_Effect_(strcat("impact_", self.material), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10
+       _sound(this, CH_TRIGGER, strcat("object/impact_", this.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTEN_NORM);
+       Send_Effect_(strcat("impact_", this.material), this.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10
 }
 
 void sandbox_ObjectFunction_Think(entity this)
 }
 
 void sandbox_ObjectFunction_Think(entity this)
index 56b549e78107d2ee0819600f30b000bc7f679a58..d04936a5dd8a880e22d72d13bc3e59232858c08b 100644 (file)
@@ -907,18 +907,18 @@ void WaypointSprite_Think(entity this)
 {
     bool doremove = false;
 
 {
     bool doremove = false;
 
-    if (self.fade_time && time >= self.teleport_time)
+    if (this.fade_time && time >= this.teleport_time)
     {
         doremove = true;
     }
 
     {
         doremove = true;
     }
 
-    if (self.exteriormodeltoclient)
-        WaypointSprite_UpdateOrigin(self, self.exteriormodeltoclient.origin + self.view_ofs);
+    if (this.exteriormodeltoclient)
+        WaypointSprite_UpdateOrigin(this, this.exteriormodeltoclient.origin + this.view_ofs);
 
     if (doremove)
 
     if (doremove)
-        WaypointSprite_Kill(self);
+        WaypointSprite_Kill(this);
     else
     else
-        self.nextthink = time; // WHY?!?
+        this.nextthink = time; // WHY?!?
 }
 
 bool WaypointSprite_visible_for_player(entity this, entity player, entity view)
 }
 
 bool WaypointSprite_visible_for_player(entity this, entity player, entity view)
@@ -970,10 +970,10 @@ float WaypointSprite_Customize(entity this)
     // make spectators see what the player would see
     entity e = WaypointSprite_getviewentity(other);
 
     // make spectators see what the player would see
     entity e = WaypointSprite_getviewentity(other);
 
-    if (MUTATOR_CALLHOOK(CustomizeWaypoint, self, other))
+    if (MUTATOR_CALLHOOK(CustomizeWaypoint, this, other))
         return false;
 
         return false;
 
-    return self.waypointsprite_visible_for_player(self, other, e);
+    return this.waypointsprite_visible_for_player(this, other, e);
 }
 
 bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
 }
 
 bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
index a64651b30e092dd2939cb513bcab941744d0ba35..250c3ba2b28e121d7e4568a4a87baf134d5ac45b 100644 (file)
@@ -6,20 +6,20 @@
 
 /**
     Simulate drag
 
 /**
     Simulate drag
-    self.velocity = movelib_dragvec(self.velocity,0.02,0.5);
+    this.velocity = movelib_dragvec(this.velocity,0.02,0.5);
 **/
 vector movelib_dragvec(entity this, float drag, float exp_);
 
 /**
     Simulate drag
 **/
 vector movelib_dragvec(entity this, float drag, float exp_);
 
 /**
     Simulate drag
-    self.velocity *= movelib_dragflt(somespeed,0.01,0.7);
+    this.velocity *= movelib_dragflt(somespeed,0.01,0.7);
 **/
 float movelib_dragflt(float fspeed,float drag,float exp_);
 
 /**
     Do a inertia simulation based on velocity.
     Basicaly, this allows you to simulate loss of steering with higher speed.
 **/
 float movelib_dragflt(float fspeed,float drag,float exp_);
 
 /**
     Do a inertia simulation based on velocity.
     Basicaly, this allows you to simulate loss of steering with higher speed.
-    self.velocity = movelib_inertmove_byspeed(self.velocity,newvel,1000,0.1,0.9);
+    this.velocity = movelib_inertmove_byspeed(this.velocity,newvel,1000,0.1,0.9);
 **/
 vector movelib_inertmove_byspeed(entity this, vector vel_new, float vel_max, float newmin, float oldmax);
 
 **/
 vector movelib_inertmove_byspeed(entity this, vector vel_new, float vel_max, float newmin, float oldmax);
 
@@ -31,7 +31,7 @@ void movelib_move(entity this, vector force, float max_velocity, float drag, flo
 /*
 void movelib_move_simple(vector newdir,float velo,float blendrate)
 {
 /*
 void movelib_move_simple(vector newdir,float velo,float blendrate)
 {
-    self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo;
+    this.velocity = this.velocity * (1 - blendrate) + (newdir * blendrate) * velo;
 }
 */
 #define movelib_move_simple(e,newdir,velo,blendrate) \
 }
 */
 #define movelib_move_simple(e,newdir,velo,blendrate) \
index 8848aa917bd5126e0a8fd0599d9c737b8595b816..daa0cb246e1debfa5598f4111897863932ff18f7 100644 (file)
@@ -289,7 +289,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
 #ifdef SVQC
 bool ItemSend(entity this, entity to, int sf)
 {
 #ifdef SVQC
 bool ItemSend(entity this, entity to, int sf)
 {
-       if(self.gravity)
+       if(this.gravity)
                sf |= ISF_DROP;
        else
                sf &= ~ISF_DROP;
                sf |= ISF_DROP;
        else
                sf &= ~ISF_DROP;
@@ -297,19 +297,19 @@ bool ItemSend(entity this, entity to, int sf)
        WriteHeader(MSG_ENTITY, ENT_CLIENT_ITEM);
        WriteByte(MSG_ENTITY, sf);
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_ITEM);
        WriteByte(MSG_ENTITY, sf);
 
-       //WriteByte(MSG_ENTITY, self.cnt);
+       //WriteByte(MSG_ENTITY, this.cnt);
        if(sf & ISF_LOCATION)
        {
        if(sf & ISF_LOCATION)
        {
-               WriteCoord(MSG_ENTITY, self.origin.x);
-               WriteCoord(MSG_ENTITY, self.origin.y);
-               WriteCoord(MSG_ENTITY, self.origin.z);
+               WriteCoord(MSG_ENTITY, this.origin.x);
+               WriteCoord(MSG_ENTITY, this.origin.y);
+               WriteCoord(MSG_ENTITY, this.origin.z);
        }
 
        if(sf & ISF_ANGLES)
        {
        }
 
        if(sf & ISF_ANGLES)
        {
-               WriteAngle(MSG_ENTITY, self.angles_x);
-               WriteAngle(MSG_ENTITY, self.angles_y);
-               WriteAngle(MSG_ENTITY, self.angles_z);
+               WriteAngle(MSG_ENTITY, this.angles_x);
+               WriteAngle(MSG_ENTITY, this.angles_y);
+               WriteAngle(MSG_ENTITY, this.angles_z);
        }
 
        if(sf & ISF_SIZE)
        }
 
        if(sf & ISF_SIZE)
@@ -319,30 +319,30 @@ bool ItemSend(entity this, entity to, int sf)
        }
 
        if(sf & ISF_STATUS)
        }
 
        if(sf & ISF_STATUS)
-               WriteByte(MSG_ENTITY, self.ItemStatus);
+               WriteByte(MSG_ENTITY, this.ItemStatus);
 
        if(sf & ISF_MODEL)
        {
                Pickup p = this.itemdef;
                WriteByte(MSG_ENTITY, p.instanceOfPowerup || p.instanceOfHealth || p.instanceOfArmor);
 
        if(sf & ISF_MODEL)
        {
                Pickup p = this.itemdef;
                WriteByte(MSG_ENTITY, p.instanceOfPowerup || p.instanceOfHealth || p.instanceOfArmor);
-               WriteShort(MSG_ENTITY, self.fade_end);
-               WriteShort(MSG_ENTITY, self.fade_start);
+               WriteShort(MSG_ENTITY, this.fade_end);
+               WriteShort(MSG_ENTITY, this.fade_start);
 
 
-               if(self.mdl == "")
-                       LOG_TRACE("^1WARNING!^7 self.mdl is unset for item ", self.classname, "exspect a crash just aboute now\n");
+               if(this.mdl == "")
+                       LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, "exspect a crash just aboute now\n");
 
 
-               WriteString(MSG_ENTITY, self.mdl);
+               WriteString(MSG_ENTITY, this.mdl);
        }
 
 
        if(sf & ISF_COLORMAP)
        }
 
 
        if(sf & ISF_COLORMAP)
-               WriteShort(MSG_ENTITY, self.colormap);
+               WriteShort(MSG_ENTITY, this.colormap);
 
        if(sf & ISF_DROP)
        {
 
        if(sf & ISF_DROP)
        {
-               WriteCoord(MSG_ENTITY, self.velocity.x);
-               WriteCoord(MSG_ENTITY, self.velocity.y);
-               WriteCoord(MSG_ENTITY, self.velocity.z);
+               WriteCoord(MSG_ENTITY, this.velocity.x);
+               WriteCoord(MSG_ENTITY, this.velocity.y);
+               WriteCoord(MSG_ENTITY, this.velocity.z);
        }
 
        return true;
        }
 
        return true;
@@ -385,22 +385,22 @@ bool have_pickup_item(entity this)
 /*
 float Item_Customize()
 {
 /*
 float Item_Customize()
 {
-       if(self.spawnshieldtime)
+       if(this.spawnshieldtime)
                return true;
                return true;
-       if(self.weapons & ~other.weapons)
+       if(this.weapons & ~other.weapons)
        {
        {
-               self.colormod = '0 0 0';
-               self.glowmod = self.colormod;
-               self.alpha = 0.5 + 0.5 * g_ghost_items; // halfway more alpha
+               this.colormod = '0 0 0';
+               this.glowmod = this.colormod;
+               this.alpha = 0.5 + 0.5 * g_ghost_items; // halfway more alpha
                return true;
        }
        else
        {
                if(g_ghost_items)
                {
                return true;
        }
        else
        {
                if(g_ghost_items)
                {
-                       self.colormod = stov(autocvar_g_ghost_items_color);
-                       self.glowmod = self.colormod;
-                       self.alpha = g_ghost_items;
+                       this.colormod = stov(autocvar_g_ghost_items_color);
+                       this.glowmod = this.colormod;
+                       this.alpha = g_ghost_items;
                        return true;
                }
                else
                        return true;
                }
                else
@@ -473,9 +473,9 @@ void Item_Show (entity e, float mode)
 
 void Item_Think(entity this)
 {
 
 void Item_Think(entity this)
 {
-       self.nextthink = time;
-       if(self.origin != self.oldorigin)
-               ItemUpdate(self);
+       this.nextthink = time;
+       if(this.origin != this.oldorigin)
+               ItemUpdate(this);
 }
 
 bool Item_ItemsTime_SpectatorOnly(GameItem it);
 }
 
 bool Item_ItemsTime_SpectatorOnly(GameItem it);
@@ -486,96 +486,96 @@ void Item_ItemsTime_SetTimesForAllPlayers();
 
 void Item_Respawn (entity this)
 {
 
 void Item_Respawn (entity this)
 {
-       Item_Show(self, 1);
+       Item_Show(this, 1);
        // this is ugly...
        // this is ugly...
-       if(self.items == ITEM_Strength.m_itemid)
-               sound (self, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTEN_NORM);   // play respawn sound
-       else if(self.items == ITEM_Shield.m_itemid)
-               sound (self, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTEN_NORM);     // play respawn sound
+       if(this.items == ITEM_Strength.m_itemid)
+               sound (this, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTEN_NORM);   // play respawn sound
+       else if(this.items == ITEM_Shield.m_itemid)
+               sound (this, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTEN_NORM);     // play respawn sound
        else
        else
-               sound (self, CH_TRIGGER, SND_ITEMRESPAWN, VOL_BASE, ATTEN_NORM);        // play respawn sound
-       setorigin (self, self.origin);
+               sound (this, CH_TRIGGER, SND_ITEMRESPAWN, VOL_BASE, ATTEN_NORM);        // play respawn sound
+       setorigin (this, this.origin);
 
 
-    if (Item_ItemsTime_Allow(self.itemdef) || self.weapons & WEPSET_SUPERWEAPONS)
+    if (Item_ItemsTime_Allow(this.itemdef) || this.weapons & WEPSET_SUPERWEAPONS)
        {
        {
-               float t = Item_ItemsTime_UpdateTime(self, 0);
-               Item_ItemsTime_SetTime(self, t);
+               float t = Item_ItemsTime_UpdateTime(this, 0);
+               Item_ItemsTime_SetTime(this, t);
                Item_ItemsTime_SetTimesForAllPlayers();
        }
 
                Item_ItemsTime_SetTimesForAllPlayers();
        }
 
-       setthink(self, Item_Think);
-       self.nextthink = time;
+       setthink(this, Item_Think);
+       this.nextthink = time;
 
 
-       //Send_Effect(EFFECT_ITEM_RESPAWN, self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
-       Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+       //Send_Effect(EFFECT_ITEM_RESPAWN, this.origin + this.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
+       Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
 }
 
 void Item_RespawnCountdown (entity this)
 {
 }
 
 void Item_RespawnCountdown (entity this)
 {
-       if(self.count >= ITEM_RESPAWN_TICKS)
+       if(this.count >= ITEM_RESPAWN_TICKS)
        {
        {
-               if(self.waypointsprite_attached)
-                       WaypointSprite_Kill(self.waypointsprite_attached);
-               Item_Respawn(self);
+               if(this.waypointsprite_attached)
+                       WaypointSprite_Kill(this.waypointsprite_attached);
+               Item_Respawn(this);
        }
        else
        {
        }
        else
        {
-               self.nextthink = time + 1;
-               self.count += 1;
-               if(self.count == 1)
+               this.nextthink = time + 1;
+               this.count += 1;
+               if(this.count == 1)
                {
                        MUTATOR_CALLHOOK(Item_RespawnCountdown, string_null, '0 0 0');
                        do {
                                {
                {
                        MUTATOR_CALLHOOK(Item_RespawnCountdown, string_null, '0 0 0');
                        do {
                                {
-                                       entity wi = Weapons_from(self.weapon);
+                                       entity wi = Weapons_from(this.weapon);
                                        if (wi != WEP_Null) {
                                        if (wi != WEP_Null) {
-                                               entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_Weapon);
+                                               entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, this, '0 0 64', world, 0, this, waypointsprite_attached, true, RADARICON_Weapon);
                                                wp.wp_extra = wi.m_id;
                                                break;
                                        }
                                }
                                {
                                                wp.wp_extra = wi.m_id;
                                                break;
                                        }
                                }
                                {
-                                       entity ii = self.itemdef;
+                                       entity ii = this.itemdef;
                                        if (ii != NULL) {
                                        if (ii != NULL) {
-                                               entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_Item);
+                                               entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, this, '0 0 64', world, 0, this, waypointsprite_attached, true, RADARICON_Item);
                                                wp.wp_extra = ii.m_id;
                                                break;
                                        }
                                }
                        } while (0);
                                                wp.wp_extra = ii.m_id;
                                                break;
                                        }
                                }
                        } while (0);
-            if(self.waypointsprite_attached)
+            if(this.waypointsprite_attached)
             {
             {
-                GameItem def = self.itemdef;
+                GameItem def = this.itemdef;
                 if (Item_ItemsTime_SpectatorOnly(def))
                 if (Item_ItemsTime_SpectatorOnly(def))
-                    WaypointSprite_UpdateRule(self.waypointsprite_attached, 0, SPRITERULE_SPECTATOR);
-                WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
+                    WaypointSprite_UpdateRule(this.waypointsprite_attached, 0, SPRITERULE_SPECTATOR);
+                WaypointSprite_UpdateBuildFinished(this.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
             }
                }
 
             }
                }
 
-               if(self.waypointsprite_attached)
+               if(this.waypointsprite_attached)
                {
                        FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                {
                        FOREACH_CLIENT(IS_REAL_CLIENT(it), {
-                               if(self.waypointsprite_attached.waypointsprite_visible_for_player(self.waypointsprite_attached, it, it))
+                               if(this.waypointsprite_attached.waypointsprite_visible_for_player(this.waypointsprite_attached, it, it))
                                {
                                        msg_entity = it;
                                        soundto(MSG_ONE, this, CH_TRIGGER, SND(ITEMRESPAWNCOUNTDOWN), VOL_BASE, ATTEN_NORM);    // play respawn sound
                                }
                        });
 
                                {
                                        msg_entity = it;
                                        soundto(MSG_ONE, this, CH_TRIGGER, SND(ITEMRESPAWNCOUNTDOWN), VOL_BASE, ATTEN_NORM);    // play respawn sound
                                }
                        });
 
-                       WaypointSprite_Ping(self.waypointsprite_attached);
-                       //WaypointSprite_UpdateHealth(self.waypointsprite_attached, self.count);
+                       WaypointSprite_Ping(this.waypointsprite_attached);
+                       //WaypointSprite_UpdateHealth(this.waypointsprite_attached, this.count);
                }
        }
 }
 
 void Item_RespawnThink(entity this)
 {
                }
        }
 }
 
 void Item_RespawnThink(entity this)
 {
-       self.nextthink = time;
-       if(self.origin != self.oldorigin)
-               ItemUpdate(self);
+       this.nextthink = time;
+       if(this.origin != this.oldorigin)
+               ItemUpdate(this);
 
 
-       if(time >= self.wait)
-               Item_Respawn(self);
+       if(time >= this.wait)
+               Item_Respawn(this);
 }
 
 void Item_ScheduleRespawnIn(entity e, float t)
 }
 
 void Item_ScheduleRespawnIn(entity e, float t)
@@ -863,12 +863,12 @@ void Item_FindTeam(entity this)
 {
        entity e;
 
 {
        entity e;
 
-       if(self.effects & EF_NODRAW)
+       if(this.effects & EF_NODRAW)
        {
                // marker for item team search
        {
                // marker for item team search
-               LOG_TRACE("Initializing item team ", ftos(self.team), "\n");
+               LOG_TRACE("Initializing item team ", ftos(this.team), "\n");
                RandomSelection_Init();
                RandomSelection_Init();
-               FOREACH_ENTITY_FLOAT(team, self.team,
+               FOREACH_ENTITY_FLOAT(team, this.team,
                {
                        if(it.flags & FL_ITEM)
                        if(it.classname != "item_flag_team" && it.classname != "item_key_team")
                {
                        if(it.flags & FL_ITEM)
                        if(it.classname != "item_flag_team" && it.classname != "item_key_team")
@@ -879,7 +879,7 @@ void Item_FindTeam(entity this)
                e.state = 0;
                Item_Show(e, 1);
 
                e.state = 0;
                Item_Show(e, 1);
 
-               FOREACH_ENTITY_FLOAT(team, self.team,
+               FOREACH_ENTITY_FLOAT(team, this.team,
                {
                        if(it.flags & FL_ITEM)
                        if(it.classname != "item_flag_team" && it.classname != "item_key_team")
                {
                        if(it.flags & FL_ITEM)
                        if(it.classname != "item_flag_team" && it.classname != "item_key_team")
@@ -894,16 +894,16 @@ void Item_FindTeam(entity this)
                        }
                });
 
                        }
                });
 
-               Item_Reset(self);
+               Item_Reset(this);
        }
 }
 
 // Savage: used for item garbage-collection
 void RemoveItem(entity this)
 {
        }
 }
 
 // Savage: used for item garbage-collection
 void RemoveItem(entity this)
 {
-       if(wasfreed(self) || !self) { return; }
-       Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
-       remove(self);
+       if(wasfreed(this) || !this) { return; }
+       Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
+       remove(this);
 }
 
 // pickup evaluation functions
 }
 
 // pickup evaluation functions
@@ -1452,39 +1452,39 @@ spawnfunc(target_items)
        float n, i;
        string s;
 
        float n, i;
        string s;
 
-       self.use = target_items_use;
-       if(!self.strength_finished)
-               self.strength_finished = autocvar_g_balance_powerup_strength_time;
-       if(!self.invincible_finished)
-               self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
-       if(!self.superweapons_finished)
-               self.superweapons_finished = autocvar_g_balance_superweapons_time;
+       this.use = target_items_use;
+       if(!this.strength_finished)
+               this.strength_finished = autocvar_g_balance_powerup_strength_time;
+       if(!this.invincible_finished)
+               this.invincible_finished = autocvar_g_balance_powerup_invincible_time;
+       if(!this.superweapons_finished)
+               this.superweapons_finished = autocvar_g_balance_superweapons_time;
 
 
-       n = tokenize_console(self.netname);
+       n = tokenize_console(this.netname);
        if(argv(0) == "give")
        {
        if(argv(0) == "give")
        {
-               self.netname = substring(self.netname, argv_start_index(1), argv_end_index(-1) - argv_start_index(1));
+               this.netname = substring(this.netname, argv_start_index(1), argv_end_index(-1) - argv_start_index(1));
        }
        else
        {
                for(i = 0; i < n; ++i)
                {
        }
        else
        {
                for(i = 0; i < n; ++i)
                {
-                       if     (argv(i) == "unlimited_ammo")         self.items |= IT_UNLIMITED_AMMO;
-                       else if(argv(i) == "unlimited_weapon_ammo")  self.items |= IT_UNLIMITED_WEAPON_AMMO;
-                       else if(argv(i) == "unlimited_superweapons") self.items |= IT_UNLIMITED_SUPERWEAPONS;
-                       else if(argv(i) == "strength")               self.items |= ITEM_Strength.m_itemid;
-                       else if(argv(i) == "invincible")             self.items |= ITEM_Shield.m_itemid;
-                       else if(argv(i) == "superweapons")           self.items |= IT_SUPERWEAPON;
-                       else if(argv(i) == "jetpack")                self.items |= ITEM_Jetpack.m_itemid;
-                       else if(argv(i) == "fuel_regen")             self.items |= ITEM_JetpackRegen.m_itemid;
+                       if     (argv(i) == "unlimited_ammo")         this.items |= IT_UNLIMITED_AMMO;
+                       else if(argv(i) == "unlimited_weapon_ammo")  this.items |= IT_UNLIMITED_WEAPON_AMMO;
+                       else if(argv(i) == "unlimited_superweapons") this.items |= IT_UNLIMITED_SUPERWEAPONS;
+                       else if(argv(i) == "strength")               this.items |= ITEM_Strength.m_itemid;
+                       else if(argv(i) == "invincible")             this.items |= ITEM_Shield.m_itemid;
+                       else if(argv(i) == "superweapons")           this.items |= IT_SUPERWEAPON;
+                       else if(argv(i) == "jetpack")                this.items |= ITEM_Jetpack.m_itemid;
+                       else if(argv(i) == "fuel_regen")             this.items |= ITEM_JetpackRegen.m_itemid;
                        else
                        {
                                FOREACH(Weapons, it != WEP_Null, {
                                        s = W_UndeprecateName(argv(i));
                                        if(s == it.netname)
                                        {
                        else
                        {
                                FOREACH(Weapons, it != WEP_Null, {
                                        s = W_UndeprecateName(argv(i));
                                        if(s == it.netname)
                                        {
-                                               self.weapons |= (it.m_wepset);
-                                               if(self.spawnflags == 0 || self.spawnflags == 2)
+                                               this.weapons |= (it.m_wepset);
+                                               if(this.spawnflags == 0 || this.spawnflags == 2)
                                                        it.wr_init(it);
                                                break;
                                        }
                                                        it.wr_init(it);
                                                break;
                                        }
@@ -1493,22 +1493,22 @@ spawnfunc(target_items)
                }
 
                string itemprefix, valueprefix;
                }
 
                string itemprefix, valueprefix;
-               if(self.spawnflags == 0)
+               if(this.spawnflags == 0)
                {
                        itemprefix = "";
                        valueprefix = "";
                }
                {
                        itemprefix = "";
                        valueprefix = "";
                }
-               else if(self.spawnflags == 1)
+               else if(this.spawnflags == 1)
                {
                        itemprefix = "max ";
                        valueprefix = "max ";
                }
                {
                        itemprefix = "max ";
                        valueprefix = "max ";
                }
-               else if(self.spawnflags == 2)
+               else if(this.spawnflags == 2)
                {
                        itemprefix = "min ";
                        valueprefix = "min ";
                }
                {
                        itemprefix = "min ";
                        valueprefix = "min ";
                }
-               else if(self.spawnflags == 4)
+               else if(this.spawnflags == 4)
                {
                        itemprefix = "minus ";
                        valueprefix = "max ";
                {
                        itemprefix = "minus ";
                        valueprefix = "max ";
@@ -1519,28 +1519,28 @@ spawnfunc(target_items)
                        itemprefix = valueprefix = string_null;
                }
 
                        itemprefix = valueprefix = string_null;
                }
 
-               self.netname = "";
-               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, boolean(self.items & IT_UNLIMITED_WEAPON_AMMO), "unlimited_weapon_ammo");
-               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, boolean(self.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
-               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.strength_finished * boolean(self.items & ITEM_Strength.m_itemid), "strength");
-               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.invincible_finished * boolean(self.items & ITEM_Shield.m_itemid), "invincible");
-               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.superweapons_finished * boolean(self.items & IT_SUPERWEAPON), "superweapons");
-               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, boolean(self.items & ITEM_Jetpack.m_itemid), "jetpack");
-               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, boolean(self.items & ITEM_JetpackRegen.m_itemid), "fuel_regen");
-               if(self.ammo_shells != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_shells), "shells");
-               if(self.ammo_nails != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_nails), "nails");
-               if(self.ammo_rockets != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_rockets), "rockets");
-               if(self.ammo_cells != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_cells), "cells");
-               if(self.ammo_plasma != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_plasma), "plasma");
-               if(self.ammo_fuel != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_fuel), "fuel");
-               if(self.health != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "health");
-               if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.armorvalue), "armor");
-               FOREACH(Weapons, it != WEP_Null, self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & (it.m_wepset)), it.netname));
+               this.netname = "";
+               this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_WEAPON_AMMO), "unlimited_weapon_ammo");
+               this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
+               this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.strength_finished * boolean(this.items & ITEM_Strength.m_itemid), "strength");
+               this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.invincible_finished * boolean(this.items & ITEM_Shield.m_itemid), "invincible");
+               this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.superweapons_finished * boolean(this.items & IT_SUPERWEAPON), "superweapons");
+               this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & ITEM_Jetpack.m_itemid), "jetpack");
+               this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & ITEM_JetpackRegen.m_itemid), "fuel_regen");
+               if(this.ammo_shells != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.ammo_shells), "shells");
+               if(this.ammo_nails != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.ammo_nails), "nails");
+               if(this.ammo_rockets != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.ammo_rockets), "rockets");
+               if(this.ammo_cells != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.ammo_cells), "cells");
+               if(this.ammo_plasma != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.ammo_plasma), "plasma");
+               if(this.ammo_fuel != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.ammo_fuel), "fuel");
+               if(this.health != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.health), "health");
+               if(this.armorvalue != 0) this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, max(0, this.armorvalue), "armor");
+               FOREACH(Weapons, it != WEP_Null, this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, !!(this.weapons & (it.m_wepset)), it.netname));
        }
        }
-       self.netname = strzone(self.netname);
-       //print(self.netname, "\n");
+       this.netname = strzone(this.netname);
+       //print(this.netname, "\n");
 
 
-       n = tokenize_console(self.netname);
+       n = tokenize_console(this.netname);
        for(i = 0; i < n; ++i)
        {
                FOREACH(Weapons, it != WEP_Null && argv(i) == it.netname, {
        for(i = 0; i < n; ++i)
        {
                FOREACH(Weapons, it != WEP_Null && argv(i) == it.netname, {
index e030632498d2c3f0cfb488135edd51245dedc642..583efbe2590076f54d31f2dd2d7af9ff5453067f 100644 (file)
@@ -3,20 +3,20 @@
 void func_bobbing_controller_think(entity this)
 {
        vector v;
 void func_bobbing_controller_think(entity this)
 {
        vector v;
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 
 
-       if(self.owner.active != ACTIVE_ACTIVE)
+       if(this.owner.active != ACTIVE_ACTIVE)
        {
        {
-               self.owner.velocity = '0 0 0';
+               this.owner.velocity = '0 0 0';
                return;
        }
 
        // calculate sinewave using makevectors
                return;
        }
 
        // calculate sinewave using makevectors
-       makevectors((self.nextthink * self.owner.cnt + self.owner.phase * 360) * '0 1 0');
-       v = self.owner.destvec + self.owner.movedir * v_forward_y;
-       if(self.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
+       makevectors((this.nextthink * this.owner.cnt + this.owner.phase * 360) * '0 1 0');
+       v = this.owner.destvec + this.owner.movedir * v_forward_y;
+       if(this.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
                // * 10 so it will arrive in 0.1 sec
                // * 10 so it will arrive in 0.1 sec
-               self.owner.velocity = (v - self.owner.SUB_ORIGIN) * 10;
+               this.owner.velocity = (v - this.owner.SUB_ORIGIN) * 10;
 }
 
 /*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
 }
 
 /*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
index ed972cd9f97b1c78b86e2c9414af318c351f1181..8424776ff0645a1c39ccfda635d81d05ba24d9c0 100644 (file)
@@ -6,25 +6,25 @@ void button_return(entity this);
 
 void button_wait(entity this)
 {
 
 void button_wait(entity this)
 {
-       self.state = STATE_TOP;
-       self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
-       SUB_THINK(self, button_return);
-       SUB_UseTargets(self, self.enemy, NULL);
-       self.frame = 1;                 // use alternate textures
+       this.state = STATE_TOP;
+       this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+       SUB_THINK(this, button_return);
+       SUB_UseTargets(this, this.enemy, NULL);
+       this.frame = 1;                 // use alternate textures
 }
 
 void button_done(entity this)
 {
 }
 
 void button_done(entity this)
 {
-       self.state = STATE_BOTTOM;
+       this.state = STATE_BOTTOM;
 }
 
 void button_return(entity this)
 {
 }
 
 void button_return(entity this)
 {
-       self.state = STATE_DOWN;
-       SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, button_done);
-       self.frame = 0;                 // use normal textures
-       if (self.health)
-               self.takedamage = DAMAGE_YES;   // can be shot again
+       this.state = STATE_DOWN;
+       SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, button_done);
+       this.frame = 0;                 // use normal textures
+       if (this.health)
+               this.takedamage = DAMAGE_YES;   // can be shot again
 }
 
 
 }
 
 
@@ -36,17 +36,17 @@ void button_blocked()
 
 void button_fire(entity this)
 {
 
 void button_fire(entity this)
 {
-       self.health = self.max_health;
-       self.takedamage = DAMAGE_NO;    // will be reset upon return
+       this.health = this.max_health;
+       this.takedamage = DAMAGE_NO;    // will be reset upon return
 
 
-       if (self.state == STATE_UP || self.state == STATE_TOP)
+       if (this.state == STATE_UP || this.state == STATE_TOP)
                return;
 
                return;
 
-       if (self.noise != "")
-               _sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
+       if (this.noise != "")
+               _sound (this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
 
 
-       self.state = STATE_UP;
-       SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, button_wait);
+       this.state = STATE_UP;
+       SUB_CalcMove (this, this.pos2, TSPEED_LINEAR, this.speed, button_wait);
 }
 
 void button_reset(entity this)
 }
 
 void button_reset(entity this)
@@ -74,12 +74,12 @@ void button_touch(entity this)
                return;
        if (!other.iscreature)
                return;
                return;
        if (!other.iscreature)
                return;
-       if(other.velocity * self.movedir < 0)
+       if(other.velocity * this.movedir < 0)
                return;
                return;
-       self.enemy = other;
+       this.enemy = other;
        if (other.owner)
        if (other.owner)
-               self.enemy = other.owner;
-       button_fire (self);
+               this.enemy = other.owner;
+       button_fire (this);
 }
 
 void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 }
 
 void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
index a4be9fe0538dd1ffad145f2beba54765025de6af..e86eefb2c10158c3ae4bfadd7a106bbc0e4eee99 100644 (file)
@@ -4,47 +4,47 @@ void conveyor_think(entity this)
 {
 #ifdef CSQC
        // TODO: check if this is what is causing the glitchiness when switching between them
 {
 #ifdef CSQC
        // TODO: check if this is what is causing the glitchiness when switching between them
-       float dt = time - self.move_time;
-       self.move_time = time;
+       float dt = time - this.move_time;
+       this.move_time = time;
        if(dt <= 0) { return; }
 #endif
        entity e;
 
        if(dt <= 0) { return; }
 #endif
        entity e;
 
-       // set myself as current conveyor where possible
-       for(e = world; (e = findentity(e, conveyor, self)); )
+       // set mythis as current conveyor where possible
+       for(e = world; (e = findentity(e, conveyor, this)); )
                e.conveyor = world;
 
                e.conveyor = world;
 
-       if(self.state)
+       if(this.state)
        {
        {
-               for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain)
+               for(e = findradius((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1); e; e = e.chain)
                        if(!e.conveyor.state)
                                if(isPushable(e))
                                {
                                        vector emin = e.absmin;
                                        vector emax = e.absmax;
                        if(!e.conveyor.state)
                                if(isPushable(e))
                                {
                                        vector emin = e.absmin;
                                        vector emax = e.absmax;
-                                       if(self.solid == SOLID_BSP)
+                                       if(this.solid == SOLID_BSP)
                                        {
                                                emin -= '1 1 1';
                                                emax += '1 1 1';
                                        }
                                        {
                                                emin -= '1 1 1';
                                                emax += '1 1 1';
                                        }
-                                       if(boxesoverlap(emin, emax, self.absmin, self.absmax)) // quick
-                                               if(WarpZoneLib_BoxTouchesBrush(emin, emax, self, e)) // accurate
-                                                       e.conveyor = self;
+                                       if(boxesoverlap(emin, emax, this.absmin, this.absmax)) // quick
+                                               if(WarpZoneLib_BoxTouchesBrush(emin, emax, this, e)) // accurate
+                                                       e.conveyor = this;
                                }
 
                                }
 
-               for(e = world; (e = findentity(e, conveyor, self)); )
+               for(e = world; (e = findentity(e, conveyor, this)); )
                {
                        if(IS_CLIENT(e)) // doing it via velocity has quite some advantages
                                continue; // done in SV_PlayerPhysics   continue;
 
                {
                        if(IS_CLIENT(e)) // doing it via velocity has quite some advantages
                                continue; // done in SV_PlayerPhysics   continue;
 
-                       setorigin(e, e.origin + self.movedir * PHYS_INPUT_FRAMETIME);
+                       setorigin(e, e.origin + this.movedir * PHYS_INPUT_FRAMETIME);
                        move_out_of_solid(e);
 #ifdef SVQC
                        UpdateCSQCProjectile(e);
 #endif
                        /*
                        // stupid conveyor code
                        move_out_of_solid(e);
 #ifdef SVQC
                        UpdateCSQCProjectile(e);
 #endif
                        /*
                        // stupid conveyor code
-                       tracebox(e.origin, e.mins, e.maxs, e.origin + self.movedir * sys_frametime, MOVE_NORMAL, e);
+                       tracebox(e.origin, e.mins, e.maxs, e.origin + this.movedir * sys_frametime, MOVE_NORMAL, e);
                        if(trace_fraction > 0)
                                setorigin(e, trace_endpos);
                        */
                        if(trace_fraction > 0)
                                setorigin(e, trace_endpos);
                        */
@@ -52,7 +52,7 @@ void conveyor_think(entity this)
        }
 
 #ifdef SVQC
        }
 
 #ifdef SVQC
-       self.nextthink = time;
+       this.nextthink = time;
 #endif
 }
 
 #endif
 }
 
@@ -79,31 +79,31 @@ bool conveyor_send(entity this, entity to, int sf)
 
        if(sf & 1)
        {
 
        if(sf & 1)
        {
-               WriteByte(MSG_ENTITY, self.warpzone_isboxy);
-               WriteCoord(MSG_ENTITY, self.origin_x);
-               WriteCoord(MSG_ENTITY, self.origin_y);
-               WriteCoord(MSG_ENTITY, self.origin_z);
-
-               WriteCoord(MSG_ENTITY, self.mins_x);
-               WriteCoord(MSG_ENTITY, self.mins_y);
-               WriteCoord(MSG_ENTITY, self.mins_z);
-               WriteCoord(MSG_ENTITY, self.maxs_x);
-               WriteCoord(MSG_ENTITY, self.maxs_y);
-               WriteCoord(MSG_ENTITY, self.maxs_z);
-
-               WriteCoord(MSG_ENTITY, self.movedir_x);
-               WriteCoord(MSG_ENTITY, self.movedir_y);
-               WriteCoord(MSG_ENTITY, self.movedir_z);
-
-               WriteByte(MSG_ENTITY, self.speed);
-               WriteByte(MSG_ENTITY, self.state);
-
-               WriteString(MSG_ENTITY, self.targetname);
-               WriteString(MSG_ENTITY, self.target);
+               WriteByte(MSG_ENTITY, this.warpzone_isboxy);
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
+
+               WriteCoord(MSG_ENTITY, this.mins_x);
+               WriteCoord(MSG_ENTITY, this.mins_y);
+               WriteCoord(MSG_ENTITY, this.mins_z);
+               WriteCoord(MSG_ENTITY, this.maxs_x);
+               WriteCoord(MSG_ENTITY, this.maxs_y);
+               WriteCoord(MSG_ENTITY, this.maxs_z);
+
+               WriteCoord(MSG_ENTITY, this.movedir_x);
+               WriteCoord(MSG_ENTITY, this.movedir_y);
+               WriteCoord(MSG_ENTITY, this.movedir_z);
+
+               WriteByte(MSG_ENTITY, this.speed);
+               WriteByte(MSG_ENTITY, this.state);
+
+               WriteString(MSG_ENTITY, this.targetname);
+               WriteString(MSG_ENTITY, this.target);
        }
 
        if(sf & 2)
        }
 
        if(sf & 2)
-               WriteByte(MSG_ENTITY, self.state);
+               WriteByte(MSG_ENTITY, this.state);
 
        return true;
 }
 
        return true;
 }
index 580d63a145a6ee20ae5f94388d818fd5ca1cf389..248896d8b2f2ce5cdb778663a22d34ed0d8c60a3 100644 (file)
@@ -27,7 +27,7 @@ void door_rotating_go_up(entity this);
 
 void door_blocked()
 {SELFPARAM();
 
 void door_blocked()
 {SELFPARAM();
-       if((self.spawnflags & 8)
+       if((this.spawnflags & 8)
 #ifdef SVQC
                && (other.takedamage != DAMAGE_NO)
 #elif defined(CSQC)
 #ifdef SVQC
                && (other.takedamage != DAMAGE_NO)
 #elif defined(CSQC)
@@ -36,14 +36,14 @@ void door_blocked()
        )
        { // KIll Kill Kill!!
 #ifdef SVQC
        )
        { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
        }
        else
        {
 #ifdef SVQC
 #endif
        }
        else
        {
 #ifdef SVQC
-               if((self.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               if((this.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
+                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
 
                 // don't change direction for dead or dying stuff
 #endif
 
                 // don't change direction for dead or dying stuff
@@ -53,23 +53,23 @@ void door_blocked()
 #endif
                )
                {
 #endif
                )
                {
-                       if (self.wait >= 0)
+                       if (this.wait >= 0)
                        {
                        {
-                               if (self.state == STATE_DOWN)
-                       if (self.classname == "door")
+                               if (this.state == STATE_DOWN)
+                       if (this.classname == "door")
                        {
                        {
-                               door_go_up (self);
+                               door_go_up (this);
                        } else
                        {
                        } else
                        {
-                               door_rotating_go_up (self);
+                               door_rotating_go_up (this);
                        }
                                else
                        }
                                else
-                       if (self.classname == "door")
+                       if (this.classname == "door")
                        {
                        {
-                               door_go_down (self);
+                               door_go_down (this);
                        } else
                        {
                        } else
                        {
-                               door_rotating_go_down (self);
+                               door_rotating_go_down (this);
                        }
                        }
                }
                        }
                        }
                }
@@ -77,8 +77,8 @@ void door_blocked()
                else
                {
                        //gib dying stuff just to make sure
                else
                {
                        //gib dying stuff just to make sure
-                       if((self.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
-                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       if((this.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
+                               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
        }
                }
 #endif
        }
@@ -86,63 +86,63 @@ void door_blocked()
 
 void door_hit_top(entity this)
 {
 
 void door_hit_top(entity this)
 {
-       if (self.noise1 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
-       self.state = STATE_TOP;
-       if (self.spawnflags & DOOR_TOGGLE)
+       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
                return;         // don't come down automatically
-       if (self.classname == "door")
+       if (this.classname == "door")
        {
        {
-               SUB_THINK(self, door_go_down);
+               SUB_THINK(this, door_go_down);
        } else
        {
        } else
        {
-               SUB_THINK(self, door_rotating_go_down);
+               SUB_THINK(this, door_rotating_go_down);
        }
        }
-       self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
+       this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
 }
 
 void door_hit_bottom(entity this)
 {
 }
 
 void door_hit_bottom(entity this)
 {
-       if (self.noise1 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
-       self.state = STATE_BOTTOM;
+       if (this.noise1 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
+       this.state = STATE_BOTTOM;
 }
 
 void door_go_down(entity this)
 {
 }
 
 void door_go_down(entity this)
 {
-       if (self.noise2 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       if (self.max_health)
+       if (this.noise2 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       if (this.max_health)
        {
        {
-               self.takedamage = DAMAGE_YES;
-               self.health = self.max_health;
+               this.takedamage = DAMAGE_YES;
+               this.health = this.max_health;
        }
 
        }
 
-       self.state = STATE_DOWN;
-       SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, door_hit_bottom);
+       this.state = STATE_DOWN;
+       SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, door_hit_bottom);
 }
 
 void door_go_up(entity this)
 {
 }
 
 void door_go_up(entity this)
 {
-       if (self.state == STATE_UP)
+       if (this.state == STATE_UP)
                return;         // already going up
 
                return;         // already going up
 
-       if (self.state == STATE_TOP)
+       if (this.state == STATE_TOP)
        {       // reset top wait time
        {       // reset top wait time
-               self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
+               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
                return;
        }
 
                return;
        }
 
-       if (self.noise2 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       self.state = STATE_UP;
-       SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, door_hit_top);
+       if (this.noise2 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       this.state = STATE_UP;
+       SUB_CalcMove (this, this.pos2, TSPEED_LINEAR, this.speed, door_hit_top);
 
        string oldmessage;
 
        string oldmessage;
-       oldmessage = self.message;
-       self.message = "";
-       SUB_UseTargets(self, NULL, NULL);
-       self.message = oldmessage;
+       oldmessage = this.message;
+       this.message = "";
+       SUB_UseTargets(this, NULL, NULL);
+       this.message = oldmessage;
 }
 
 
 }
 
 
@@ -252,7 +252,7 @@ void door_fire(entity this, entity actor, entity trigger)
 
 void door_use(entity this, entity actor, entity trigger)
 {
 
 void door_use(entity this, entity actor, entity trigger)
 {
-       //dprint("door_use (model: ");dprint(self.model);dprint(")\n");
+       //dprint("door_use (model: ");dprint(this.model);dprint(")\n");
 
        if (this.owner)
                WITHSELF(this.owner, door_fire(this.owner, actor, trigger));
 
        if (this.owner)
                WITHSELF(this.owner, door_fire(this.owner, actor, trigger));
@@ -293,17 +293,17 @@ void door_touch(entity this)
 {
        if (!IS_PLAYER(other))
                return;
 {
        if (!IS_PLAYER(other))
                return;
-       if (self.owner.door_finished > time)
+       if (this.owner.door_finished > time)
                return;
 
                return;
 
-       self.owner.door_finished = time + 2;
+       this.owner.door_finished = time + 2;
 
 #ifdef SVQC
 
 #ifdef SVQC
-       if (!(self.owner.dmg) && (self.owner.message != ""))
+       if (!(this.owner.dmg) && (this.owner.message != ""))
        {
                if (IS_CLIENT(other))
        {
                if (IS_CLIENT(other))
-                       centerprint(other, self.owner.message);
-               play2(other, self.owner.noise);
+                       centerprint(other, this.owner.message);
+               play2(other, this.owner.noise);
        }
 #endif
 }
        }
 #endif
 }
@@ -311,36 +311,36 @@ void door_touch(entity this)
 void door_generic_plat_blocked(entity this)
 {
 
 void door_generic_plat_blocked(entity this)
 {
 
-       if((self.spawnflags & 8) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
+       if((this.spawnflags & 8) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
 #ifdef SVQC
 #ifdef SVQC
-               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
        }
        else
        {
 
 #ifdef SVQC
 #endif
        }
        else
        {
 
 #ifdef SVQC
-               if((self.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               if((this.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
+                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
 
                 //Dont chamge direction for dead or dying stuff
                if(IS_DEAD(other) && (other.takedamage == DAMAGE_NO))
                {
 #endif
 
                 //Dont chamge direction for dead or dying stuff
                if(IS_DEAD(other) && (other.takedamage == DAMAGE_NO))
                {
-                       if (self.wait >= 0)
+                       if (this.wait >= 0)
                        {
                        {
-                               if (self.state == STATE_DOWN)
-                                       door_rotating_go_up (self);
+                               if (this.state == STATE_DOWN)
+                                       door_rotating_go_up (this);
                                else
                                else
-                                       door_rotating_go_down (self);
+                                       door_rotating_go_down (this);
                        }
                }
 #ifdef SVQC
                else
                {
                        //gib dying stuff just to make sure
                        }
                }
 #ifdef SVQC
                else
                {
                        //gib dying stuff just to make sure
-                       if((self.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
-                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       if((this.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
+                               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
        }
                }
 #endif
        }
@@ -348,61 +348,61 @@ void door_generic_plat_blocked(entity this)
 
 void door_rotating_hit_top(entity this)
 {
 
 void door_rotating_hit_top(entity this)
 {
-       if (self.noise1 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
-       self.state = STATE_TOP;
-       if (self.spawnflags & DOOR_TOGGLE)
+       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
                return;         // don't come down automatically
-       SUB_THINK(self, door_rotating_go_down);
-       self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
+       SUB_THINK(this, door_rotating_go_down);
+       this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
 }
 
 void door_rotating_hit_bottom(entity this)
 {
 }
 
 void door_rotating_hit_bottom(entity this)
 {
-       if (self.noise1 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
-       if (self.lip==666) // self.lip is used to remember reverse opening direction for door_rotating
+       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
        {
        {
-               self.pos2 = '0 0 0' - self.pos2;
-               self.lip = 0;
+               this.pos2 = '0 0 0' - this.pos2;
+               this.lip = 0;
        }
        }
-       self.state = STATE_BOTTOM;
+       this.state = STATE_BOTTOM;
 }
 
 void door_rotating_go_down(entity this)
 {
 }
 
 void door_rotating_go_down(entity this)
 {
-       if (self.noise2 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       if (self.max_health)
+       if (this.noise2 != "")
+               _sound (this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       if (this.max_health)
        {
        {
-               self.takedamage = DAMAGE_YES;
-               self.health = self.max_health;
+               this.takedamage = DAMAGE_YES;
+               this.health = this.max_health;
        }
 
        }
 
-       self.state = STATE_DOWN;
-       SUB_CalcAngleMove (self, self.pos1, TSPEED_LINEAR, self.speed, door_rotating_hit_bottom);
+       this.state = STATE_DOWN;
+       SUB_CalcAngleMove (this, this.pos1, TSPEED_LINEAR, this.speed, door_rotating_hit_bottom);
 }
 
 void door_rotating_go_up(entity this)
 {
 }
 
 void door_rotating_go_up(entity this)
 {
-       if (self.state == STATE_UP)
+       if (this.state == STATE_UP)
                return;         // already going up
 
                return;         // already going up
 
-       if (self.state == STATE_TOP)
+       if (this.state == STATE_TOP)
        {       // reset top wait time
        {       // reset top wait time
-               self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
+               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
                return;
        }
                return;
        }
-       if (self.noise2 != "")
-               _sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       self.state = STATE_UP;
-       SUB_CalcAngleMove (self, self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top);
+       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;
 
        string oldmessage;
-       oldmessage = self.message;
-       self.message = "";
-       SUB_UseTargets(self, NULL, other); // TODO: is other needed here?
-       self.message = oldmessage;
+       oldmessage = this.message;
+       this.message = "";
+       SUB_UseTargets(this, NULL, other); // TODO: is other needed here?
+       this.message = oldmessage;
 }
 
 
 }
 
 
@@ -424,14 +424,14 @@ void door_trigger_touch(entity this)
 #endif
                        return;
 
 #endif
                        return;
 
-       if (time < self.door_finished)
+       if (time < this.door_finished)
                return;
 
        // check if door is locked
                return;
 
        // check if door is locked
-       if (!door_check_keys(self, other))
+       if (!door_check_keys(this, other))
                return;
 
                return;
 
-       self.door_finished = time + 1;
+       this.door_finished = time + 1;
 
        door_use(this.owner, other, NULL);
 }
 
        door_use(this.owner, other, NULL);
 }
@@ -444,7 +444,7 @@ void door_spawnfield(entity this, vector fmins, vector fmaxs)
        trigger = new(doortriggerfield);
        trigger.movetype = MOVETYPE_NONE;
        trigger.solid = SOLID_TRIGGER;
        trigger = new(doortriggerfield);
        trigger.movetype = MOVETYPE_NONE;
        trigger.solid = SOLID_TRIGGER;
-       trigger.owner = self;
+       trigger.owner = this;
 #ifdef SVQC
        settouch(trigger, door_trigger_touch);
 #endif
 #ifdef SVQC
        settouch(trigger, door_trigger_touch);
 #endif
@@ -494,51 +494,51 @@ void LinkDoors(entity this)
        door_link();
 #endif
 
        door_link();
 #endif
 
-       if (self.enemy)
+       if (this.enemy)
                return;         // already linked by another door
                return;         // already linked by another door
-       if (self.spawnflags & 4)
+       if (this.spawnflags & 4)
        {
        {
-               self.owner = self.enemy = self;
+               this.owner = this.enemy = this;
 
 
-               if (self.health)
+               if (this.health)
                        return;
                IFTARGETED
                        return;
                        return;
                IFTARGETED
                        return;
-               if (self.items)
+               if (this.items)
                        return;
 
                        return;
 
-               door_spawnfield(self, self.absmin, self.absmax);
+               door_spawnfield(this, this.absmin, this.absmax);
 
                return;         // don't want to link this door
        }
 
 
                return;         // don't want to link this door
        }
 
-       FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, self);
+       FindConnectedComponent(this, enemy, LinkDoors_nextent, LinkDoors_isconnected, this);
 
        // set owner, and make a loop of the chain
        LOG_TRACE("LinkDoors: linking doors:");
 
        // set owner, and make a loop of the chain
        LOG_TRACE("LinkDoors: linking doors:");
-       for(t = self; ; t = t.enemy)
+       for(t = this; ; t = t.enemy)
        {
                LOG_TRACE(" ", etos(t));
        {
                LOG_TRACE(" ", etos(t));
-               t.owner = self;
+               t.owner = this;
                if(t.enemy == world)
                {
                if(t.enemy == world)
                {
-                       t.enemy = self;
+                       t.enemy = this;
                        break;
                }
        }
        LOG_TRACE("\n");
 
        // collect health, targetname, message, size
                        break;
                }
        }
        LOG_TRACE("\n");
 
        // collect health, targetname, message, size
-       cmins = self.absmin;
-       cmaxs = self.absmax;
-       for(t = self; ; t = t.enemy)
+       cmins = this.absmin;
+       cmaxs = this.absmax;
+       for(t = this; ; t = t.enemy)
        {
        {
-               if(t.health && !self.health)
-                       self.health = t.health;
-               if((t.targetname != "") && (self.targetname == ""))
-                       self.targetname = t.targetname;
-               if((t.message != "") && (self.message == ""))
-                       self.message = t.message;
+               if(t.health && !this.health)
+                       this.health = t.health;
+               if((t.targetname != "") && (this.targetname == ""))
+                       this.targetname = t.targetname;
+               if((t.message != "") && (this.message == ""))
+                       this.message = t.message;
                if (t.absmin_x < cmins_x)
                        cmins_x = t.absmin_x;
                if (t.absmin_y < cmins_y)
                if (t.absmin_x < cmins_x)
                        cmins_x = t.absmin_x;
                if (t.absmin_y < cmins_y)
@@ -551,31 +551,31 @@ void LinkDoors(entity this)
                        cmaxs_y = t.absmax_y;
                if (t.absmax_z > cmaxs_z)
                        cmaxs_z = t.absmax_z;
                        cmaxs_y = t.absmax_y;
                if (t.absmax_z > cmaxs_z)
                        cmaxs_z = t.absmax_z;
-               if(t.enemy == self)
+               if(t.enemy == this)
                        break;
        }
 
        // distribute health, targetname, message
                        break;
        }
 
        // distribute health, targetname, message
-       for(t = self; t; t = t.enemy)
+       for(t = this; t; t = t.enemy)
        {
        {
-               t.health = self.health;
-               t.targetname = self.targetname;
-               t.message = self.message;
-               if(t.enemy == self)
+               t.health = this.health;
+               t.targetname = this.targetname;
+               t.message = this.message;
+               if(t.enemy == this)
                        break;
        }
 
        // shootable, or triggered doors just needed the owner/enemy links,
        // they don't spawn a field
 
                        break;
        }
 
        // shootable, or triggered doors just needed the owner/enemy links,
        // they don't spawn a field
 
-       if (self.health)
+       if (this.health)
                return;
        IFTARGETED
                return;
                return;
        IFTARGETED
                return;
-       if (self.items)
+       if (this.items)
                return;
 
                return;
 
-       door_spawnfield(self, cmins, cmaxs);
+       door_spawnfield(this, cmins, cmaxs);
 }
 
 REGISTER_NET_LINKED(ENT_CLIENT_DOOR)
 }
 
 REGISTER_NET_LINKED(ENT_CLIENT_DOOR)
@@ -617,29 +617,29 @@ float door_send(entity this, entity to, float sf)
 
        if(sf & SF_TRIGGER_INIT)
        {
 
        if(sf & SF_TRIGGER_INIT)
        {
-               WriteString(MSG_ENTITY, self.classname);
-               WriteByte(MSG_ENTITY, self.spawnflags);
+               WriteString(MSG_ENTITY, this.classname);
+               WriteByte(MSG_ENTITY, this.spawnflags);
 
 
-               WriteString(MSG_ENTITY, self.model);
+               WriteString(MSG_ENTITY, this.model);
 
 
-               trigger_common_write(self, true);
+               trigger_common_write(this, true);
 
 
-               WriteCoord(MSG_ENTITY, self.pos1_x);
-               WriteCoord(MSG_ENTITY, self.pos1_y);
-               WriteCoord(MSG_ENTITY, self.pos1_z);
-               WriteCoord(MSG_ENTITY, self.pos2_x);
-               WriteCoord(MSG_ENTITY, self.pos2_y);
-               WriteCoord(MSG_ENTITY, self.pos2_z);
+               WriteCoord(MSG_ENTITY, this.pos1_x);
+               WriteCoord(MSG_ENTITY, this.pos1_y);
+               WriteCoord(MSG_ENTITY, this.pos1_z);
+               WriteCoord(MSG_ENTITY, this.pos2_x);
+               WriteCoord(MSG_ENTITY, this.pos2_y);
+               WriteCoord(MSG_ENTITY, this.pos2_z);
 
 
-               WriteCoord(MSG_ENTITY, self.size_x);
-               WriteCoord(MSG_ENTITY, self.size_y);
-               WriteCoord(MSG_ENTITY, self.size_z);
+               WriteCoord(MSG_ENTITY, this.size_x);
+               WriteCoord(MSG_ENTITY, this.size_y);
+               WriteCoord(MSG_ENTITY, this.size_z);
 
 
-               WriteShort(MSG_ENTITY, self.wait);
-               WriteShort(MSG_ENTITY, self.speed);
-               WriteByte(MSG_ENTITY, self.lip);
-               WriteByte(MSG_ENTITY, self.state);
-               WriteCoord(MSG_ENTITY, self.SUB_LTIME);
+               WriteShort(MSG_ENTITY, this.wait);
+               WriteShort(MSG_ENTITY, this.speed);
+               WriteByte(MSG_ENTITY, this.lip);
+               WriteByte(MSG_ENTITY, this.state);
+               WriteCoord(MSG_ENTITY, this.SUB_LTIME);
        }
 
        if(sf & SF_TRIGGER_RESET)
        }
 
        if(sf & SF_TRIGGER_RESET)
@@ -649,16 +649,16 @@ float door_send(entity this, entity to, float sf)
 
        if(sf & SF_TRIGGER_UPDATE)
        {
 
        if(sf & SF_TRIGGER_UPDATE)
        {
-               WriteCoord(MSG_ENTITY, self.origin_x);
-               WriteCoord(MSG_ENTITY, self.origin_y);
-               WriteCoord(MSG_ENTITY, self.origin_z);
-
-               WriteCoord(MSG_ENTITY, self.pos1_x);
-               WriteCoord(MSG_ENTITY, self.pos1_y);
-               WriteCoord(MSG_ENTITY, self.pos1_z);
-               WriteCoord(MSG_ENTITY, self.pos2_x);
-               WriteCoord(MSG_ENTITY, self.pos2_y);
-               WriteCoord(MSG_ENTITY, self.pos2_z);
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
+
+               WriteCoord(MSG_ENTITY, this.pos1_x);
+               WriteCoord(MSG_ENTITY, this.pos1_y);
+               WriteCoord(MSG_ENTITY, this.pos1_z);
+               WriteCoord(MSG_ENTITY, this.pos2_x);
+               WriteCoord(MSG_ENTITY, this.pos2_y);
+               WriteCoord(MSG_ENTITY, this.pos2_z);
        }
 
        return true;
        }
 
        return true;
@@ -667,19 +667,19 @@ float door_send(entity this, entity to, float sf)
 void door_link()
 {
        // set size now, as everything is loaded
 void door_link()
 {
        // set size now, as everything is loaded
-       //FixSize(self);
-       //Net_LinkEntity(self, false, 0, door_send);
+       //FixSize(this);
+       //Net_LinkEntity(this, false, 0, door_send);
 }
 #endif
 
 void door_init_startopen(entity this)
 {
 }
 #endif
 
 void door_init_startopen(entity this)
 {
-       SUB_SETORIGIN(self, self.pos2);
-       self.pos2 = self.pos1;
-       self.pos1 = self.origin;
+       SUB_SETORIGIN(this, this.pos2);
+       this.pos2 = this.pos1;
+       this.pos1 = this.origin;
 
 #ifdef SVQC
 
 #ifdef SVQC
-       self.SendFlags |= SF_TRIGGER_UPDATE;
+       this.SendFlags |= SF_TRIGGER_UPDATE;
 #endif
 }
 
 #endif
 }
 
index 504005e362733e18de841000c848af1ef7b76c4d..093382a7058fdc7ec4f6c22da835d61b008ac499 100644 (file)
@@ -38,9 +38,9 @@ void door_rotating_reset(entity this)
 
 void door_rotating_init_startopen(entity this)
 {
 
 void door_rotating_init_startopen(entity this)
 {
-       self.angles = self.movedir;
-       self.pos2 = '0 0 0';
-       self.pos1 = self.movedir;
+       this.angles = this.movedir;
+       this.pos2 = '0 0 0';
+       this.pos1 = this.movedir;
 }
 
 
 }
 
 
index 2156d5f833cf3abb45699715a97bf2c399563372..f0472fadc4b2d71f4110fccee7f05a71c66e299c 100644 (file)
@@ -71,76 +71,76 @@ void fd_secret_damage(entity this, entity inflictor, entity attacker, float dama
 // Wait after first movement...
 void fd_secret_move1(entity this)
 {
 // Wait after first movement...
 void fd_secret_move1(entity this)
 {
-       self.SUB_NEXTTHINK = self.SUB_LTIME + 1.0;
-       setthink(self, fd_secret_move2);
-       if (self.noise3 != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
+       this.SUB_NEXTTHINK = this.SUB_LTIME + 1.0;
+       setthink(this, fd_secret_move2);
+       if (this.noise3 != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
 }
 
 // Start moving sideways w/sound...
 void fd_secret_move2(entity this)
 {
 }
 
 // Start moving sideways w/sound...
 void fd_secret_move2(entity this)
 {
-       if (self.noise2 != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       SUB_CalcMove(self, self.dest2, TSPEED_LINEAR, self.speed, fd_secret_move3);
+       if (this.noise2 != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       SUB_CalcMove(this, this.dest2, TSPEED_LINEAR, this.speed, fd_secret_move3);
 }
 
 // Wait here until time to go back...
 void fd_secret_move3(entity this)
 {
 }
 
 // Wait here until time to go back...
 void fd_secret_move3(entity this)
 {
-       if (self.noise3 != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
-       if (!(self.spawnflags & SECRET_OPEN_ONCE))
+       if (this.noise3 != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
+       if (!(this.spawnflags & SECRET_OPEN_ONCE))
        {
        {
-               self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
-               setthink(self, fd_secret_move4);
+               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+               setthink(this, fd_secret_move4);
        }
 }
 
 // Move backward...
 void fd_secret_move4(entity this)
 {
        }
 }
 
 // Move backward...
 void fd_secret_move4(entity this)
 {
-       if (self.noise2 != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       SUB_CalcMove(self, self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move5);
+       if (this.noise2 != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       SUB_CalcMove(this, this.dest1, TSPEED_LINEAR, this.speed, fd_secret_move5);
 }
 
 // Wait 1 second...
 void fd_secret_move5(entity this)
 {
 }
 
 // Wait 1 second...
 void fd_secret_move5(entity this)
 {
-       self.SUB_NEXTTHINK = self.SUB_LTIME + 1.0;
-       setthink(self, fd_secret_move6);
-       if (self.noise3 != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
+       this.SUB_NEXTTHINK = this.SUB_LTIME + 1.0;
+       setthink(this, fd_secret_move6);
+       if (this.noise3 != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
 }
 
 void fd_secret_move6(entity this)
 {
 }
 
 void fd_secret_move6(entity this)
 {
-       if (self.noise2 != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       SUB_CalcMove(self, self.oldorigin, TSPEED_LINEAR, self.speed, fd_secret_done);
+       if (this.noise2 != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise2, VOL_BASE, ATTEN_NORM);
+       SUB_CalcMove(this, this.oldorigin, TSPEED_LINEAR, this.speed, fd_secret_done);
 }
 
 void fd_secret_done(entity this)
 {
 }
 
 void fd_secret_done(entity this)
 {
-       if (self.spawnflags&SECRET_YES_SHOOT)
+       if (this.spawnflags&SECRET_YES_SHOOT)
        {
        {
-               self.health = 10000;
-               self.takedamage = DAMAGE_YES;
-               //self.th_pain = fd_secret_use;
+               this.health = 10000;
+               this.takedamage = DAMAGE_YES;
+               //this.th_pain = fd_secret_use;
        }
        }
-       if (self.noise3 != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
+       if (this.noise3 != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
 }
 
 .float door_finished;
 
 void secret_blocked()
 {SELFPARAM();
 }
 
 .float door_finished;
 
 void secret_blocked()
 {SELFPARAM();
-       if (time < self.door_finished)
+       if (time < this.door_finished)
                return;
                return;
-       self.door_finished = time + 0.5;
-       //T_Damage (other, self, self, self.dmg, self.dmg, self.deathtype, DT_IMPACT, (self.absmin + self.absmax) * 0.5, '0 0 0', Obituary_Generic);
+       this.door_finished = time + 0.5;
+       //T_Damage (other, this, this, this.dmg, this.dmg, this.deathtype, DT_IMPACT, (this.absmin + this.absmax) * 0.5, '0 0 0', Obituary_Generic);
 }
 
 /*
 }
 
 /*
@@ -154,16 +154,16 @@ void secret_touch(entity this)
 {
        if (!other.iscreature)
                return;
 {
        if (!other.iscreature)
                return;
-       if (self.door_finished > time)
+       if (this.door_finished > time)
                return;
 
                return;
 
-       self.door_finished = time + 2;
+       this.door_finished = time + 2;
 
 
-       if (self.message)
+       if (this.message)
        {
                if (IS_CLIENT(other))
        {
                if (IS_CLIENT(other))
-                       centerprint(other, self.message);
-               play2(other, self.noise);
+                       centerprint(other, this.message);
+               play2(other, this.noise);
        }
 }
 
        }
 }
 
index 53366aa1054dcde093ec130031ee5a579ce86c60..cde3c5d494923a423646b7d435745b8194bfe738 100644 (file)
@@ -15,28 +15,28 @@ void func_fourier_controller_think(entity this)
        vector v;
        float n, i, t;
 
        vector v;
        float n, i, t;
 
-       self.nextthink = time + 0.1;
-       if(self.owner.active != ACTIVE_ACTIVE)
+       this.nextthink = time + 0.1;
+       if(this.owner.active != ACTIVE_ACTIVE)
        {
        {
-               self.owner.velocity = '0 0 0';
+               this.owner.velocity = '0 0 0';
                return;
        }
 
 
                return;
        }
 
 
-       n = floor((tokenize_console(self.owner.netname)) / 5);
-       t = self.nextthink * self.owner.cnt + self.owner.phase * 360;
+       n = floor((tokenize_console(this.owner.netname)) / 5);
+       t = this.nextthink * this.owner.cnt + this.owner.phase * 360;
 
 
-       v = self.owner.destvec;
+       v = this.owner.destvec;
 
        for(i = 0; i < n; ++i)
        {
                makevectors((t * stof(argv(i*5)) + stof(argv(i*5+1)) * 360) * '0 1 0');
 
        for(i = 0; i < n; ++i)
        {
                makevectors((t * stof(argv(i*5)) + stof(argv(i*5+1)) * 360) * '0 1 0');
-               v = v + ('1 0 0' * stof(argv(i*5+2)) + '0 1 0' * stof(argv(i*5+3)) + '0 0 1' * stof(argv(i*5+4))) * self.owner.height * v_forward_y;
+               v = v + ('1 0 0' * stof(argv(i*5+2)) + '0 1 0' * stof(argv(i*5+3)) + '0 0 1' * stof(argv(i*5+4))) * this.owner.height * v_forward_y;
        }
 
        }
 
-       if(self.owner.classname == "func_fourier") // don't brake stuff if the func_fourier was killtarget'ed
+       if(this.owner.classname == "func_fourier") // don't brake stuff if the func_fourier was killtarget'ed
                // * 10 so it will arrive in 0.1 sec
                // * 10 so it will arrive in 0.1 sec
-               self.owner.velocity = (v - self.owner.origin) * 10;
+               this.owner.velocity = (v - this.owner.origin) * 10;
 }
 
 spawnfunc(func_fourier)
 }
 
 spawnfunc(func_fourier)
index c446c3f3fc1f8755548f8251bfba0ec3ca39cd3d..af5065643bf9a6957fd0de37d50cba53a7f58d9c 100644 (file)
@@ -15,7 +15,7 @@ void func_ladder_touch(entity this)
        EXACTTRIGGER_TOUCH;
 
        other.ladder_time = time + 0.1;
        EXACTTRIGGER_TOUCH;
 
        other.ladder_time = time + 0.1;
-       other.ladder_entity = self;
+       other.ladder_entity = this;
 }
 
 #ifdef SVQC
 }
 
 #ifdef SVQC
@@ -23,11 +23,11 @@ bool func_ladder_send(entity this, entity to, int sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_LADDER);
 
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_LADDER);
 
-       WriteString(MSG_ENTITY, self.classname);
-       WriteByte(MSG_ENTITY, self.skin);
-       WriteCoord(MSG_ENTITY, self.speed);
+       WriteString(MSG_ENTITY, this.classname);
+       WriteByte(MSG_ENTITY, this.skin);
+       WriteCoord(MSG_ENTITY, this.speed);
 
 
-       trigger_common_write(self, false);
+       trigger_common_write(this, false);
 
        return true;
 }
 
        return true;
 }
index e05b2a6fca08927c0e081f9e1e230a70ad1a0c45..f1fffd7b927f86e7084a32b457e161c46a5d391f 100644 (file)
@@ -3,21 +3,21 @@
 void func_pendulum_controller_think(entity this)
 {
        float v;
 void func_pendulum_controller_think(entity this)
 {
        float v;
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 
 
-       if (!(self.owner.active == ACTIVE_ACTIVE))
+       if (!(this.owner.active == ACTIVE_ACTIVE))
        {
        {
-               self.owner.avelocity_x = 0;
+               this.owner.avelocity_x = 0;
                return;
        }
 
        // calculate sinewave using makevectors
                return;
        }
 
        // calculate sinewave using makevectors
-       makevectors((self.nextthink * self.owner.freq + self.owner.phase) * '0 360 0');
-       v = self.owner.speed * v_forward_y + self.cnt;
-       if(self.owner.classname == "func_pendulum") // don't brake stuff if the func_bobbing was killtarget'ed
+       makevectors((this.nextthink * this.owner.freq + this.owner.phase) * '0 360 0');
+       v = this.owner.speed * v_forward_y + this.cnt;
+       if(this.owner.classname == "func_pendulum") // don't brake stuff if the func_bobbing was killtarget'ed
        {
                // * 10 so it will arrive in 0.1 sec
        {
                // * 10 so it will arrive in 0.1 sec
-               self.owner.avelocity_z = (remainder(v - self.owner.angles_z, 360)) * 10;
+               this.owner.avelocity_z = (remainder(v - this.owner.angles_z, 360)) * 10;
        }
 }
 
        }
 }
 
index ee942f4cb57c7fc1d5b5d8eb2123f7c417dd5cba..dea0077c1f13e881512515af1e15ad6a31f65050 100644 (file)
@@ -1,11 +1,11 @@
 REGISTER_NET_LINKED(ENT_CLIENT_PLAT)
 
 #ifdef SVQC
 REGISTER_NET_LINKED(ENT_CLIENT_PLAT)
 
 #ifdef SVQC
-void plat_link();
+void plat_link(entity this);
 
 void plat_delayedinit(entity this)
 {
 
 void plat_delayedinit(entity this)
 {
-       plat_link();
+       plat_link(this);
        plat_spawn_inside_trigger(this); // the "start moving" trigger
 }
 
        plat_spawn_inside_trigger(this); // the "start moving" trigger
 }
 
@@ -16,36 +16,36 @@ float plat_send(entity this, entity to, float sf)
 
        if(sf & SF_TRIGGER_INIT)
        {
 
        if(sf & SF_TRIGGER_INIT)
        {
-               WriteByte(MSG_ENTITY, self.platmovetype_start);
-               WriteByte(MSG_ENTITY, self.platmovetype_turn);
-               WriteByte(MSG_ENTITY, self.platmovetype_end);
-               WriteByte(MSG_ENTITY, self.spawnflags);
+               WriteByte(MSG_ENTITY, this.platmovetype_start);
+               WriteByte(MSG_ENTITY, this.platmovetype_turn);
+               WriteByte(MSG_ENTITY, this.platmovetype_end);
+               WriteByte(MSG_ENTITY, this.spawnflags);
 
 
-               WriteString(MSG_ENTITY, self.model);
+               WriteString(MSG_ENTITY, this.model);
 
 
-               trigger_common_write(self, true);
+               trigger_common_write(this, true);
 
 
-               WriteCoord(MSG_ENTITY, self.pos1_x);
-               WriteCoord(MSG_ENTITY, self.pos1_y);
-               WriteCoord(MSG_ENTITY, self.pos1_z);
-               WriteCoord(MSG_ENTITY, self.pos2_x);
-               WriteCoord(MSG_ENTITY, self.pos2_y);
-               WriteCoord(MSG_ENTITY, self.pos2_z);
+               WriteCoord(MSG_ENTITY, this.pos1_x);
+               WriteCoord(MSG_ENTITY, this.pos1_y);
+               WriteCoord(MSG_ENTITY, this.pos1_z);
+               WriteCoord(MSG_ENTITY, this.pos2_x);
+               WriteCoord(MSG_ENTITY, this.pos2_y);
+               WriteCoord(MSG_ENTITY, this.pos2_z);
 
 
-               WriteCoord(MSG_ENTITY, self.size_x);
-               WriteCoord(MSG_ENTITY, self.size_y);
-               WriteCoord(MSG_ENTITY, self.size_z);
+               WriteCoord(MSG_ENTITY, this.size_x);
+               WriteCoord(MSG_ENTITY, this.size_y);
+               WriteCoord(MSG_ENTITY, this.size_z);
 
 
-               WriteAngle(MSG_ENTITY, self.mangle_x);
-               WriteAngle(MSG_ENTITY, self.mangle_y);
-               WriteAngle(MSG_ENTITY, self.mangle_z);
+               WriteAngle(MSG_ENTITY, this.mangle_x);
+               WriteAngle(MSG_ENTITY, this.mangle_y);
+               WriteAngle(MSG_ENTITY, this.mangle_z);
 
 
-               WriteShort(MSG_ENTITY, self.speed);
-               WriteShort(MSG_ENTITY, self.height);
-               WriteByte(MSG_ENTITY, self.lip);
-               WriteByte(MSG_ENTITY, self.state);
+               WriteShort(MSG_ENTITY, this.speed);
+               WriteShort(MSG_ENTITY, this.height);
+               WriteByte(MSG_ENTITY, this.lip);
+               WriteByte(MSG_ENTITY, this.state);
 
 
-               WriteShort(MSG_ENTITY, self.dmg);
+               WriteShort(MSG_ENTITY, this.dmg);
        }
 
        if(sf & SF_TRIGGER_RESET)
        }
 
        if(sf & SF_TRIGGER_RESET)
@@ -56,9 +56,9 @@ float plat_send(entity this, entity to, float sf)
        return true;
 }
 
        return true;
 }
 
-void plat_link()
+void plat_link(entity this)
 {
 {
-       //Net_LinkEntity(self, 0, false, plat_send);
+       //Net_LinkEntity(this, 0, false, plat_send);
 }
 
 spawnfunc(func_plat)
 }
 
 spawnfunc(func_plat)
index 9cfc01acbf20f6c85488ff24453ac3d7af711f60..ece31ac0e9c9716a67bc342c767d1c4c44031268 100644 (file)
@@ -9,42 +9,42 @@ bool pointparticles_SendEntity(entity this, entity to, float fl)
 
        // optional features to save space
        fl = fl & 0x0F;
 
        // optional features to save space
        fl = fl & 0x0F;
-       if(self.spawnflags & 2)
+       if(this.spawnflags & 2)
                fl |= 0x10; // absolute count on toggle-on
                fl |= 0x10; // absolute count on toggle-on
-       if(self.movedir != '0 0 0' || self.velocity != '0 0 0')
+       if(this.movedir != '0 0 0' || this.velocity != '0 0 0')
                fl |= 0x20; // 4 bytes - saves CPU
                fl |= 0x20; // 4 bytes - saves CPU
-       if(self.waterlevel || self.count != 1)
+       if(this.waterlevel || this.count != 1)
                fl |= 0x40; // 4 bytes - obscure features almost never used
                fl |= 0x40; // 4 bytes - obscure features almost never used
-       if(self.mins != '0 0 0' || self.maxs != '0 0 0')
+       if(this.mins != '0 0 0' || this.maxs != '0 0 0')
                fl |= 0x80; // 14 bytes - saves lots of space
 
        WriteByte(MSG_ENTITY, fl);
        if(fl & 2)
        {
                fl |= 0x80; // 14 bytes - saves lots of space
 
        WriteByte(MSG_ENTITY, fl);
        if(fl & 2)
        {
-               if(self.state)
-                       WriteCoord(MSG_ENTITY, self.impulse);
+               if(this.state)
+                       WriteCoord(MSG_ENTITY, this.impulse);
                else
                        WriteCoord(MSG_ENTITY, 0); // off
        }
        if(fl & 4)
        {
                else
                        WriteCoord(MSG_ENTITY, 0); // off
        }
        if(fl & 4)
        {
-               WriteCoord(MSG_ENTITY, self.origin_x);
-               WriteCoord(MSG_ENTITY, self.origin_y);
-               WriteCoord(MSG_ENTITY, self.origin_z);
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
        }
        if(fl & 1)
        {
        }
        if(fl & 1)
        {
-               if(self.model != "null")
+               if(this.model != "null")
                {
                {
-                       WriteShort(MSG_ENTITY, self.modelindex);
+                       WriteShort(MSG_ENTITY, this.modelindex);
                        if(fl & 0x80)
                        {
                        if(fl & 0x80)
                        {
-                               WriteCoord(MSG_ENTITY, self.mins_x);
-                               WriteCoord(MSG_ENTITY, self.mins_y);
-                               WriteCoord(MSG_ENTITY, self.mins_z);
-                               WriteCoord(MSG_ENTITY, self.maxs_x);
-                               WriteCoord(MSG_ENTITY, self.maxs_y);
-                               WriteCoord(MSG_ENTITY, self.maxs_z);
+                               WriteCoord(MSG_ENTITY, this.mins_x);
+                               WriteCoord(MSG_ENTITY, this.mins_y);
+                               WriteCoord(MSG_ENTITY, this.mins_z);
+                               WriteCoord(MSG_ENTITY, this.maxs_x);
+                               WriteCoord(MSG_ENTITY, this.maxs_y);
+                               WriteCoord(MSG_ENTITY, this.maxs_z);
                        }
                }
                else
                        }
                }
                else
@@ -52,36 +52,36 @@ bool pointparticles_SendEntity(entity this, entity to, float fl)
                        WriteShort(MSG_ENTITY, 0);
                        if(fl & 0x80)
                        {
                        WriteShort(MSG_ENTITY, 0);
                        if(fl & 0x80)
                        {
-                               WriteCoord(MSG_ENTITY, self.maxs_x);
-                               WriteCoord(MSG_ENTITY, self.maxs_y);
-                               WriteCoord(MSG_ENTITY, self.maxs_z);
+                               WriteCoord(MSG_ENTITY, this.maxs_x);
+                               WriteCoord(MSG_ENTITY, this.maxs_y);
+                               WriteCoord(MSG_ENTITY, this.maxs_z);
                        }
                }
                        }
                }
-               WriteShort(MSG_ENTITY, self.cnt);
-               WriteString(MSG_ENTITY, self.mdl);
+               WriteShort(MSG_ENTITY, this.cnt);
+               WriteString(MSG_ENTITY, this.mdl);
                if(fl & 0x20)
                {
                if(fl & 0x20)
                {
-                       WriteShort(MSG_ENTITY, compressShortVector(self.velocity));
-                       WriteShort(MSG_ENTITY, compressShortVector(self.movedir));
+                       WriteShort(MSG_ENTITY, compressShortVector(this.velocity));
+                       WriteShort(MSG_ENTITY, compressShortVector(this.movedir));
                }
                if(fl & 0x40)
                {
                }
                if(fl & 0x40)
                {
-                       WriteShort(MSG_ENTITY, self.waterlevel * 16.0);
-                       WriteByte(MSG_ENTITY, self.count * 16.0);
+                       WriteShort(MSG_ENTITY, this.waterlevel * 16.0);
+                       WriteByte(MSG_ENTITY, this.count * 16.0);
                }
                }
-               WriteString(MSG_ENTITY, self.noise);
-               if(self.noise != "")
+               WriteString(MSG_ENTITY, this.noise);
+               if(this.noise != "")
                {
                {
-                       WriteByte(MSG_ENTITY, floor(self.atten * 64));
-                       WriteByte(MSG_ENTITY, floor(self.volume * 255));
+                       WriteByte(MSG_ENTITY, floor(this.atten * 64));
+                       WriteByte(MSG_ENTITY, floor(this.volume * 255));
                }
                }
-               WriteString(MSG_ENTITY, self.bgmscript);
-               if(self.bgmscript != "")
+               WriteString(MSG_ENTITY, this.bgmscript);
+               if(this.bgmscript != "")
                {
                {
-                       WriteByte(MSG_ENTITY, floor(self.bgmscriptattack * 64));
-                       WriteByte(MSG_ENTITY, floor(self.bgmscriptdecay * 64));
-                       WriteByte(MSG_ENTITY, floor(self.bgmscriptsustain * 255));
-                       WriteByte(MSG_ENTITY, floor(self.bgmscriptrelease * 64));
+                       WriteByte(MSG_ENTITY, floor(this.bgmscriptattack * 64));
+                       WriteByte(MSG_ENTITY, floor(this.bgmscriptdecay * 64));
+                       WriteByte(MSG_ENTITY, floor(this.bgmscriptsustain * 255));
+                       WriteByte(MSG_ENTITY, floor(this.bgmscriptrelease * 64));
                }
        }
        return 1;
                }
        }
        return 1;
@@ -95,12 +95,12 @@ void pointparticles_use(entity this, entity actor, entity trigger)
 
 void pointparticles_think(entity this)
 {
 
 void pointparticles_think(entity this)
 {
-       if(self.origin != self.oldorigin)
+       if(this.origin != this.oldorigin)
        {
        {
-               self.SendFlags |= 4;
-               self.oldorigin = self.origin;
+               this.SendFlags |= 4;
+               this.oldorigin = this.origin;
        }
        }
-       self.nextthink = time;
+       this.nextthink = time;
 }
 
 void pointparticles_reset(entity this)
 }
 
 void pointparticles_reset(entity this)
@@ -149,25 +149,25 @@ spawnfunc(func_pointparticles)
 
 spawnfunc(func_sparks)
 {
 
 spawnfunc(func_sparks)
 {
-       // self.cnt is the amount of sparks that one burst will spawn
-       if(self.cnt < 1) {
-               self.cnt = 25.0; // nice default value
+       // this.cnt is the amount of sparks that one burst will spawn
+       if(this.cnt < 1) {
+               this.cnt = 25.0; // nice default value
        }
 
        }
 
-       // self.wait is the probability that a sparkthink will spawn a spark shower
+       // this.wait is the probability that a sparkthink will spawn a spark shower
        // range: 0 - 1, but 0 makes little sense, so...
        // range: 0 - 1, but 0 makes little sense, so...
-       if(self.wait < 0.05) {
-               self.wait = 0.25; // nice default value
+       if(this.wait < 0.05) {
+               this.wait = 0.25; // nice default value
        }
 
        }
 
-       self.count = self.cnt;
-       self.mins = '0 0 0';
-       self.maxs = '0 0 0';
-       self.velocity = '0 0 -1';
-       self.mdl = "TE_SPARK";
-       self.impulse = 10 * self.wait; // by default 2.5/sec
-       self.wait = 0;
-       self.cnt = 0; // use mdl
+       this.count = this.cnt;
+       this.mins = '0 0 0';
+       this.maxs = '0 0 0';
+       this.velocity = '0 0 -1';
+       this.mdl = "TE_SPARK";
+       this.impulse = 10 * this.wait; // by default 2.5/sec
+       this.wait = 0;
+       this.cnt = 0; // use mdl
 
        spawnfunc_func_pointparticles(this);
 }
 
        spawnfunc_func_pointparticles(this);
 }
index 18b8d083416541da0cf310aedd7b8aca1085e329..425a6fe8a23302176a621d62755236a60e08990c 100644 (file)
@@ -6,58 +6,58 @@ void train_use(entity this, entity actor, entity trigger);
 void train_wait(entity this)
 {
        SUB_UseTargets(this.enemy, NULL, NULL);
 void train_wait(entity this)
 {
        SUB_UseTargets(this.enemy, NULL, NULL);
-       self.enemy = world;
+       this.enemy = world;
 
        // if turning is enabled, the train will turn toward the next point while waiting
 
        // if turning is enabled, the train will turn toward the next point while waiting
-       if(self.platmovetype_turn && !self.train_wait_turning)
+       if(this.platmovetype_turn && !this.train_wait_turning)
        {
                entity targ, cp;
                vector ang;
        {
                entity targ, cp;
                vector ang;
-               targ = find(world, targetname, self.target);
-               if((self.spawnflags & 1) && targ.curvetarget)
+               targ = find(world, targetname, this.target);
+               if((this.spawnflags & 1) && targ.curvetarget)
                        cp = find(world, targetname, targ.curvetarget);
                else
                        cp = world;
 
                if(cp) // bezier curves movement
                        cp = find(world, targetname, targ.curvetarget);
                else
                        cp = world;
 
                if(cp) // bezier curves movement
-                       ang = cp.origin - (self.origin - self.view_ofs); // use the origin of the control point of the next path_corner
+                       ang = cp.origin - (this.origin - this.view_ofs); // use the origin of the control point of the next path_corner
                else // linear movement
                else // linear movement
-                       ang = targ.origin - (self.origin - self.view_ofs); // use the origin of the next path_corner
+                       ang = targ.origin - (this.origin - this.view_ofs); // use the origin of the next path_corner
                ang = vectoangles(ang);
                ang_x = -ang_x; // flip up / down orientation
 
                ang = vectoangles(ang);
                ang_x = -ang_x; // flip up / down orientation
 
-               if(self.wait > 0) // slow turning
-                       SUB_CalcAngleMove(self, ang, TSPEED_TIME, self.SUB_LTIME - time + self.wait, train_wait);
+               if(this.wait > 0) // slow turning
+                       SUB_CalcAngleMove(this, ang, TSPEED_TIME, this.SUB_LTIME - time + this.wait, train_wait);
                else // instant turning
                else // instant turning
-                       SUB_CalcAngleMove(self, ang, TSPEED_TIME, 0.0000001, train_wait);
-               self.train_wait_turning = true;
+                       SUB_CalcAngleMove(this, ang, TSPEED_TIME, 0.0000001, train_wait);
+               this.train_wait_turning = true;
                return;
        }
 
 #ifdef SVQC
                return;
        }
 
 #ifdef SVQC
-       if(self.noise != "")
-               stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
+       if(this.noise != "")
+               stopsoundto(MSG_BROADCAST, this, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
 #endif
 
 #ifdef SVQC
 #endif
 
 #ifdef SVQC
-       entity tg = find(world, targetname, self.target);
+       entity tg = find(world, targetname, this.target);
        if(tg.spawnflags & 4)
        {
        if(tg.spawnflags & 4)
        {
-               self.use = train_use;
-               SUB_THINK(self, func_null);
-               self.SUB_NEXTTHINK = 0;
+               this.use = train_use;
+               SUB_THINK(this, func_null);
+               this.SUB_NEXTTHINK = 0;
        }
        else
 #endif
        }
        else
 #endif
-            if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
+            if(this.wait < 0 || this.train_wait_turning) // no waiting or we already waited while turning
        {
        {
-               self.train_wait_turning = false;
-               train_next(self);
+               this.train_wait_turning = false;
+               train_next(this);
        }
        else
        {
        }
        else
        {
-               SUB_THINK(self, train_next);
-               self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
+               SUB_THINK(this, train_next);
+               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
        }
 }
 
        }
 }
 
@@ -66,52 +66,52 @@ void train_next(entity this)
        entity targ, cp = world;
        vector cp_org = '0 0 0';
 
        entity targ, cp = world;
        vector cp_org = '0 0 0';
 
-       targ = find(world, targetname, self.target);
-       self.target = targ.target;
-       if (self.spawnflags & 1)
+       targ = find(world, targetname, this.target);
+       this.target = targ.target;
+       if (this.spawnflags & 1)
        {
                if(targ.curvetarget)
                {
                        cp = find(world, targetname, targ.curvetarget); // get its second target (the control point)
        {
                if(targ.curvetarget)
                {
                        cp = find(world, targetname, targ.curvetarget); // get its second target (the control point)
-                       cp_org = cp.origin - self.view_ofs; // no control point found, assume a straight line to the destination
+                       cp_org = cp.origin - this.view_ofs; // no control point found, assume a straight line to the destination
                }
        }
                }
        }
-       if (self.target == "")
+       if (this.target == "")
                objerror("train_next: no next target");
                objerror("train_next: no next target");
-       self.wait = targ.wait;
-       if (!self.wait)
-               self.wait = 0.1;
+       this.wait = targ.wait;
+       if (!this.wait)
+               this.wait = 0.1;
 
        if(targ.platmovetype)
        {
                // this path_corner contains a movetype overrider, apply it
 
        if(targ.platmovetype)
        {
                // this path_corner contains a movetype overrider, apply it
-               self.platmovetype_start = targ.platmovetype_start;
-               self.platmovetype_end = targ.platmovetype_end;
+               this.platmovetype_start = targ.platmovetype_start;
+               this.platmovetype_end = targ.platmovetype_end;
        }
        else
        {
                // this path_corner doesn't contain a movetype overrider, use the train's defaults
        }
        else
        {
                // this path_corner doesn't contain a movetype overrider, use the train's defaults
-               self.platmovetype_start = self.platmovetype_start_default;
-               self.platmovetype_end = self.platmovetype_end_default;
+               this.platmovetype_start = this.platmovetype_start_default;
+               this.platmovetype_end = this.platmovetype_end_default;
        }
 
        if (targ.speed)
        {
                if (cp)
        }
 
        if (targ.speed)
        {
                if (cp)
-                       SUB_CalcMove_Bezier(self, cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+                       SUB_CalcMove_Bezier(this, cp_org, targ.origin - this.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
                else
                else
-                       SUB_CalcMove(self, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+                       SUB_CalcMove(this, targ.origin - this.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
        }
        else
        {
                if (cp)
        }
        else
        {
                if (cp)
-                       SUB_CalcMove_Bezier(self, cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+                       SUB_CalcMove_Bezier(this, cp_org, targ.origin - this.view_ofs, TSPEED_LINEAR, this.speed, train_wait);
                else
                else
-                       SUB_CalcMove(self, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+                       SUB_CalcMove(this, targ.origin - this.view_ofs, TSPEED_LINEAR, this.speed, train_wait);
        }
 
        }
 
-       if(self.noise != "")
-               _sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
+       if(this.noise != "")
+               _sound(this, CH_TRIGGER_SINGLE, this.noise, VOL_BASE, ATTEN_IDLE);
 }
 
 REGISTER_NET_LINKED(ENT_CLIENT_TRAIN)
 }
 
 REGISTER_NET_LINKED(ENT_CLIENT_TRAIN)
@@ -124,43 +124,43 @@ float train_send(entity this, entity to, float sf)
 
        if(sf & SF_TRIGGER_INIT)
        {
 
        if(sf & SF_TRIGGER_INIT)
        {
-               WriteString(MSG_ENTITY, self.platmovetype);
-               WriteByte(MSG_ENTITY, self.platmovetype_turn);
-               WriteByte(MSG_ENTITY, self.spawnflags);
+               WriteString(MSG_ENTITY, this.platmovetype);
+               WriteByte(MSG_ENTITY, this.platmovetype_turn);
+               WriteByte(MSG_ENTITY, this.spawnflags);
 
 
-               WriteString(MSG_ENTITY, self.model);
+               WriteString(MSG_ENTITY, this.model);
 
 
-               trigger_common_write(self, true);
+               trigger_common_write(this, true);
 
 
-               WriteString(MSG_ENTITY, self.curvetarget);
+               WriteString(MSG_ENTITY, this.curvetarget);
 
 
-               WriteCoord(MSG_ENTITY, self.pos1_x);
-               WriteCoord(MSG_ENTITY, self.pos1_y);
-               WriteCoord(MSG_ENTITY, self.pos1_z);
-               WriteCoord(MSG_ENTITY, self.pos2_x);
-               WriteCoord(MSG_ENTITY, self.pos2_y);
-               WriteCoord(MSG_ENTITY, self.pos2_z);
+               WriteCoord(MSG_ENTITY, this.pos1_x);
+               WriteCoord(MSG_ENTITY, this.pos1_y);
+               WriteCoord(MSG_ENTITY, this.pos1_z);
+               WriteCoord(MSG_ENTITY, this.pos2_x);
+               WriteCoord(MSG_ENTITY, this.pos2_y);
+               WriteCoord(MSG_ENTITY, this.pos2_z);
 
 
-               WriteCoord(MSG_ENTITY, self.size_x);
-               WriteCoord(MSG_ENTITY, self.size_y);
-               WriteCoord(MSG_ENTITY, self.size_z);
+               WriteCoord(MSG_ENTITY, this.size_x);
+               WriteCoord(MSG_ENTITY, this.size_y);
+               WriteCoord(MSG_ENTITY, this.size_z);
 
 
-               WriteCoord(MSG_ENTITY, self.view_ofs_x);
-               WriteCoord(MSG_ENTITY, self.view_ofs_y);
-               WriteCoord(MSG_ENTITY, self.view_ofs_z);
+               WriteCoord(MSG_ENTITY, this.view_ofs_x);
+               WriteCoord(MSG_ENTITY, this.view_ofs_y);
+               WriteCoord(MSG_ENTITY, this.view_ofs_z);
 
 
-               WriteAngle(MSG_ENTITY, self.mangle_x);
-               WriteAngle(MSG_ENTITY, self.mangle_y);
-               WriteAngle(MSG_ENTITY, self.mangle_z);
+               WriteAngle(MSG_ENTITY, this.mangle_x);
+               WriteAngle(MSG_ENTITY, this.mangle_y);
+               WriteAngle(MSG_ENTITY, this.mangle_z);
 
 
-               WriteShort(MSG_ENTITY, self.speed);
-               WriteShort(MSG_ENTITY, self.height);
-               WriteByte(MSG_ENTITY, self.lip);
-               WriteByte(MSG_ENTITY, self.state);
-               WriteByte(MSG_ENTITY, self.wait);
+               WriteShort(MSG_ENTITY, this.speed);
+               WriteShort(MSG_ENTITY, this.height);
+               WriteByte(MSG_ENTITY, this.lip);
+               WriteByte(MSG_ENTITY, this.state);
+               WriteByte(MSG_ENTITY, this.wait);
 
 
-               WriteShort(MSG_ENTITY, self.dmg);
-               WriteByte(MSG_ENTITY, self.dmgtime);
+               WriteShort(MSG_ENTITY, this.dmg);
+               WriteByte(MSG_ENTITY, this.dmgtime);
        }
 
        if(sf & SF_TRIGGER_RESET)
        }
 
        if(sf & SF_TRIGGER_RESET)
@@ -171,9 +171,9 @@ float train_send(entity this, entity to, float sf)
        return true;
 }
 
        return true;
 }
 
-void train_link()
+void train_link(entity this)
 {
 {
-       //Net_LinkEntity(self, 0, false, train_send);
+       //Net_LinkEntity(this, 0, false, train_send);
 }
 
 void train_use(entity this, entity actor, entity trigger)
 }
 
 void train_use(entity this, entity actor, entity trigger)
@@ -186,19 +186,19 @@ void train_use(entity this, entity actor, entity trigger)
 void func_train_find(entity this)
 {
        entity targ;
 void func_train_find(entity this)
 {
        entity targ;
-       targ = find(world, targetname, self.target);
-       self.target = targ.target;
-       if (self.target == "")
+       targ = find(world, targetname, this.target);
+       this.target = targ.target;
+       if (this.target == "")
                objerror("func_train_find: no next target");
                objerror("func_train_find: no next target");
-       SUB_SETORIGIN(self, targ.origin - self.view_ofs);
+       SUB_SETORIGIN(this, targ.origin - this.view_ofs);
 
 
-       if(!(self.spawnflags & 4))
+       if(!(this.spawnflags & 4))
        {
        {
-               self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
-               SUB_THINK(self, train_next);
+               this.SUB_NEXTTHINK = this.SUB_LTIME + 1;
+               SUB_THINK(this, train_next);
        }
 
        }
 
-       train_link();
+       train_link(this);
 }
 
 #endif
 }
 
 #endif
index b3e931b3a364f66f7e5389a396dc9fdde2aa3111..dd8804106c2672ca6e18e23de9ca0d98b62af0e4 100644 (file)
@@ -59,16 +59,16 @@ vector func_vectormamamam_origin(entity o, float t)
 
 void func_vectormamamam_controller_think(entity this)
 {
 
 void func_vectormamamam_controller_think(entity this)
 {
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 
 
-       if(self.owner.active != ACTIVE_ACTIVE)
+       if(this.owner.active != ACTIVE_ACTIVE)
        {
        {
-               self.owner.velocity = '0 0 0';
+               this.owner.velocity = '0 0 0';
                return;
        }
 
                return;
        }
 
-       if(self.owner.classname == "func_vectormamamam") // don't brake stuff if the func_vectormamamam was killtarget'ed
-               self.owner.velocity = (self.owner.destvec + func_vectormamamam_origin(self.owner, 0.1) - self.owner.origin) * 10;
+       if(this.owner.classname == "func_vectormamamam") // don't brake stuff if the func_vectormamamam was killtarget'ed
+               this.owner.velocity = (this.owner.destvec + func_vectormamamam_origin(this.owner, 0.1) - this.owner.origin) * 10;
 }
 
 void func_vectormamamam_findtarget(entity this)
 }
 
 void func_vectormamamam_findtarget(entity this)
index f0aafc7c40e5d06238324f87b0eb6d14dec518bb..15c7e26301daed6d06699502447e5bfb9fa2eeed 100644 (file)
@@ -51,8 +51,8 @@ void misc_laser_aim(entity this)
 
 void misc_laser_init(entity this)
 {
 
 void misc_laser_init(entity this)
 {
-       if(self.target != "")
-               self.enemy = find(world, targetname, self.target);
+       if(this.target != "")
+               this.enemy = find(world, targetname, this.target);
 }
 
 .entity pusher;
 }
 
 .entity pusher;
@@ -62,62 +62,62 @@ void misc_laser_think(entity this)
        entity hitent;
        vector hitloc;
 
        entity hitent;
        vector hitloc;
 
-       self.nextthink = time;
+       this.nextthink = time;
 
 
-       if(!self.state)
+       if(!this.state)
                return;
 
        misc_laser_aim(this);
 
                return;
 
        misc_laser_aim(this);
 
-       if(self.enemy)
+       if(this.enemy)
        {
        {
-               o = self.enemy.origin;
-               if (!(self.spawnflags & 2))
-                       o = self.origin + normalize(o - self.origin) * 32768;
+               o = this.enemy.origin;
+               if (!(this.spawnflags & 2))
+                       o = this.origin + normalize(o - this.origin) * 32768;
        }
        else
        {
        }
        else
        {
-               makevectors(self.mangle);
-               o = self.origin + v_forward * 32768;
+               makevectors(this.mangle);
+               o = this.origin + v_forward * 32768;
        }
 
        }
 
-       if(self.dmg || self.enemy.target != "")
+       if(this.dmg || this.enemy.target != "")
        {
        {
-               traceline(self.origin, o, MOVE_NORMAL, self);
+               traceline(this.origin, o, MOVE_NORMAL, this);
        }
        hitent = trace_ent;
        hitloc = trace_endpos;
 
        }
        hitent = trace_ent;
        hitloc = trace_endpos;
 
-       if(self.enemy.target != "") // DETECTOR laser
+       if(this.enemy.target != "") // DETECTOR laser
        {
                if(trace_ent.iscreature)
                {
        {
                if(trace_ent.iscreature)
                {
-                       self.pusher = hitent;
-                       if(!self.count)
+                       this.pusher = hitent;
+                       if(!this.count)
                        {
                        {
-                               self.count = 1;
+                               this.count = 1;
 
 
-                               SUB_UseTargets(self.enemy, self.enemy.pusher, NULL);
+                               SUB_UseTargets(this.enemy, this.enemy.pusher, NULL);
                        }
                }
                else
                {
                        }
                }
                else
                {
-                       if(self.count)
+                       if(this.count)
                        {
                        {
-                               self.count = 0;
+                               this.count = 0;
 
 
-                               SUB_UseTargets(self.enemy, self.enemy.pusher, NULL);
+                               SUB_UseTargets(this.enemy, this.enemy.pusher, NULL);
                        }
                }
        }
 
                        }
                }
        }
 
-       if(self.dmg)
+       if(this.dmg)
        {
        {
-               if(self.team)
-                       if(((self.spawnflags & 8) == 0) == (self.team != hitent.team))
+               if(this.team)
+                       if(((this.spawnflags & 8) == 0) == (this.team != hitent.team))
                                return;
                if(hitent.takedamage)
                                return;
                if(hitent.takedamage)
-                       Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER.m_id, hitloc, '0 0 0');
+                       Damage(hitent, this, this, ((this.dmg < 0) ? 100000 : (this.dmg * frametime)), DEATH_HURTTRIGGER.m_id, hitloc, '0 0 0');
        }
 }
 
        }
 }
 
@@ -125,52 +125,52 @@ bool laser_SendEntity(entity this, entity to, float fl)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_LASER);
        fl = fl - (fl & 0xF0); // use that bit to indicate finite length laser
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_LASER);
        fl = fl - (fl & 0xF0); // use that bit to indicate finite length laser
-       if(self.spawnflags & 2)
+       if(this.spawnflags & 2)
                fl |= 0x80;
                fl |= 0x80;
-       if(self.alpha)
+       if(this.alpha)
                fl |= 0x40;
                fl |= 0x40;
-       if(self.scale != 1 || self.modelscale != 1)
+       if(this.scale != 1 || this.modelscale != 1)
                fl |= 0x20;
                fl |= 0x20;
-       if(self.spawnflags & 4)
+       if(this.spawnflags & 4)
                fl |= 0x10;
        WriteByte(MSG_ENTITY, fl);
        if(fl & 1)
        {
                fl |= 0x10;
        WriteByte(MSG_ENTITY, fl);
        if(fl & 1)
        {
-               WriteCoord(MSG_ENTITY, self.origin_x);
-               WriteCoord(MSG_ENTITY, self.origin_y);
-               WriteCoord(MSG_ENTITY, self.origin_z);
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
        }
        if(fl & 8)
        {
        }
        if(fl & 8)
        {
-               WriteByte(MSG_ENTITY, self.colormod_x * 255.0);
-               WriteByte(MSG_ENTITY, self.colormod_y * 255.0);
-               WriteByte(MSG_ENTITY, self.colormod_z * 255.0);
+               WriteByte(MSG_ENTITY, this.colormod_x * 255.0);
+               WriteByte(MSG_ENTITY, this.colormod_y * 255.0);
+               WriteByte(MSG_ENTITY, this.colormod_z * 255.0);
                if(fl & 0x40)
                if(fl & 0x40)
-                       WriteByte(MSG_ENTITY, self.alpha * 255.0);
+                       WriteByte(MSG_ENTITY, this.alpha * 255.0);
                if(fl & 0x20)
                {
                if(fl & 0x20)
                {
-                       WriteByte(MSG_ENTITY, bound(0, self.scale * 16.0, 255));
-                       WriteByte(MSG_ENTITY, bound(0, self.modelscale * 16.0, 255));
+                       WriteByte(MSG_ENTITY, bound(0, this.scale * 16.0, 255));
+                       WriteByte(MSG_ENTITY, bound(0, this.modelscale * 16.0, 255));
                }
                if((fl & 0x80) || !(fl & 0x10)) // effect doesn't need sending if the laser is infinite and has collision testing turned off
                }
                if((fl & 0x80) || !(fl & 0x10)) // effect doesn't need sending if the laser is infinite and has collision testing turned off
-                       WriteShort(MSG_ENTITY, self.cnt + 1);
+                       WriteShort(MSG_ENTITY, this.cnt + 1);
        }
        if(fl & 2)
        {
                if(fl & 0x80)
                {
        }
        if(fl & 2)
        {
                if(fl & 0x80)
                {
-                       WriteCoord(MSG_ENTITY, self.enemy.origin_x);
-                       WriteCoord(MSG_ENTITY, self.enemy.origin_y);
-                       WriteCoord(MSG_ENTITY, self.enemy.origin_z);
+                       WriteCoord(MSG_ENTITY, this.enemy.origin_x);
+                       WriteCoord(MSG_ENTITY, this.enemy.origin_y);
+                       WriteCoord(MSG_ENTITY, this.enemy.origin_z);
                }
                else
                {
                }
                else
                {
-                       WriteAngle(MSG_ENTITY, self.mangle_x);
-                       WriteAngle(MSG_ENTITY, self.mangle_y);
+                       WriteAngle(MSG_ENTITY, this.mangle_x);
+                       WriteAngle(MSG_ENTITY, this.mangle_y);
                }
        }
        if(fl & 4)
                }
        }
        if(fl & 4)
-               WriteByte(MSG_ENTITY, self.state);
+               WriteByte(MSG_ENTITY, this.state);
        return 1;
 }
 
        return 1;
 }
 
index 3819e9c7fc97d7549fb1cd2d0c9883588ac433be..b29894664edd80f2db8bf3e95c2f2a0119c3c2c9 100644 (file)
@@ -2,17 +2,17 @@ void generic_plat_blocked()
 {
 #ifdef SVQC
     SELFPARAM();
 {
 #ifdef SVQC
     SELFPARAM();
-       if(self.dmg && other.takedamage != DAMAGE_NO)
+       if(this.dmg && other.takedamage != DAMAGE_NO)
        {
        {
-               if(self.dmgtime2 < time)
+               if(this.dmgtime2 < time)
                {
                {
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
-                       self.dmgtime2 = time + self.dmgtime;
+                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       this.dmgtime2 = time + this.dmgtime;
                }
 
                // Gib dead/dying stuff
                if(IS_DEAD(other))
                }
 
                // Gib dead/dying stuff
                if(IS_DEAD(other))
-                       Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
        }
 #endif
 }
        }
 #endif
 }
@@ -26,22 +26,22 @@ void plat_spawn_inside_trigger(entity this)
        settouch(trigger, plat_center_touch);
        trigger.movetype = MOVETYPE_NONE;
        trigger.solid = SOLID_TRIGGER;
        settouch(trigger, plat_center_touch);
        trigger.movetype = MOVETYPE_NONE;
        trigger.solid = SOLID_TRIGGER;
-       trigger.enemy = self;
+       trigger.enemy = this;
 
 
-       tmin = self.absmin + '25 25 0';
-       tmax = self.absmax - '25 25 -8';
-       tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8);
-       if (self.spawnflags & PLAT_LOW_TRIGGER)
+       tmin = this.absmin + '25 25 0';
+       tmax = this.absmax - '25 25 -8';
+       tmin_z = tmax_z - (this.pos1_z - this.pos2_z + 8);
+       if (this.spawnflags & PLAT_LOW_TRIGGER)
                tmax_z = tmin_z + 8;
 
                tmax_z = tmin_z + 8;
 
-       if (self.size_x <= 50)
+       if (this.size_x <= 50)
        {
        {
-               tmin_x = (self.mins_x + self.maxs_x) / 2;
+               tmin_x = (this.mins_x + this.maxs_x) / 2;
                tmax_x = tmin_x + 1;
        }
                tmax_x = tmin_x + 1;
        }
-       if (self.size_y <= 50)
+       if (this.size_y <= 50)
        {
        {
-               tmin_y = (self.mins_y + self.maxs_y) / 2;
+               tmin_y = (this.mins_y + this.maxs_y) / 2;
                tmax_y = tmin_y + 1;
        }
 
                tmax_y = tmin_y + 1;
        }
 
@@ -60,31 +60,31 @@ void plat_spawn_inside_trigger(entity this)
 
 void plat_hit_top(entity this)
 {
 
 void plat_hit_top(entity this)
 {
-       _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
-       self.state = 1;
+       _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
+       this.state = 1;
 
 
-       SUB_THINK(self, plat_go_down);
-       self.SUB_NEXTTHINK = self.SUB_LTIME + 3;
+       SUB_THINK(this, plat_go_down);
+       this.SUB_NEXTTHINK = this.SUB_LTIME + 3;
 }
 
 void plat_hit_bottom(entity this)
 {
 }
 
 void plat_hit_bottom(entity this)
 {
-       _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
-       self.state = 2;
+       _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
+       this.state = 2;
 }
 
 void plat_go_down(entity this)
 {
 }
 
 void plat_go_down(entity this)
 {
-       _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
-       self.state = 3;
-       SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom);
+       _sound (this, CH_TRIGGER_SINGLE, this.noise, VOL_BASE, ATTEN_NORM);
+       this.state = 3;
+       SUB_CalcMove (this, this.pos2, TSPEED_LINEAR, this.speed, plat_hit_bottom);
 }
 
 void plat_go_up(entity this)
 {
 }
 
 void plat_go_up(entity this)
 {
-       _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
-       self.state = 4;
-       SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
+       _sound (this, CH_TRIGGER_SINGLE, this.noise, VOL_BASE, ATTEN_NORM);
+       this.state = 4;
+       SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, plat_hit_top);
 }
 
 void plat_center_touch(entity this)
 }
 
 void plat_center_touch(entity this)
@@ -102,11 +102,11 @@ void plat_center_touch(entity this)
                return;
 #endif
 
                return;
 #endif
 
-       if (self.enemy.state == 2) {
-               entity e = self.enemy;
+       if (this.enemy.state == 2) {
+               entity e = this.enemy;
                WITHSELF(e, plat_go_up(e));
                WITHSELF(e, plat_go_up(e));
-       } else if (self.enemy.state == 1)
-               self.enemy.SUB_NEXTTHINK = self.enemy.SUB_LTIME + 1;
+       } else if (this.enemy.state == 1)
+               this.enemy.SUB_NEXTTHINK = this.enemy.SUB_LTIME + 1;
 }
 
 void plat_outside_touch(entity this)
 }
 
 void plat_outside_touch(entity this)
@@ -122,8 +122,8 @@ void plat_outside_touch(entity this)
                return;
 #endif
 
                return;
 #endif
 
-       if (self.enemy.state == 1) {
-           entity e = self.enemy;
+       if (this.enemy.state == 1) {
+           entity e = this.enemy;
                WITHSELF(e, plat_go_down(e));
     }
 }
                WITHSELF(e, plat_go_down(e));
     }
 }
@@ -143,28 +143,28 @@ void plat_trigger_use(entity this, entity actor, entity trigger)
 
 void plat_crush()
 {SELFPARAM();
 
 void plat_crush()
 {SELFPARAM();
-       if((self.spawnflags & 4) && (other.takedamage != DAMAGE_NO))
+       if((this.spawnflags & 4) && (other.takedamage != DAMAGE_NO))
        { // KIll Kill Kill!!
 #ifdef SVQC
        { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
        }
        else
        {
 #ifdef SVQC
 #endif
        }
        else
        {
 #ifdef SVQC
-               if((self.dmg) && (other.takedamage != DAMAGE_NO))
+               if((this.dmg) && (other.takedamage != DAMAGE_NO))
                {   // Shall we bite?
                {   // Shall we bite?
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                        // Gib dead/dying stuff
                        if(IS_DEAD(other))
                        // Gib dead/dying stuff
                        if(IS_DEAD(other))
-                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
 
                }
 #endif
 
-               if (self.state == 4)
-                       plat_go_down (self);
-               else if (self.state == 3)
-                       plat_go_up (self);
+               if (this.state == 4)
+                       plat_go_down (this);
+               else if (this.state == 3)
+                       plat_go_up (this);
        // when in other states, then the plat_crush event came delayed after
        // plat state already had changed
        // this isn't a bug per se!
        // when in other states, then the plat_crush event came delayed after
        // plat state already had changed
        // this isn't a bug per se!
index bb92dcca001b240b7c9a1f6693a14e6d43cb1dea..6389a03cda7f450bef288cba18feba5e48aa4991 100644 (file)
@@ -7,15 +7,15 @@ void SUB_CalcAngleMoveDone(entity this);
 ==================
 SUB_Friction
 
 ==================
 SUB_Friction
 
-Applies some friction to self
+Applies some friction to this
 ==================
 */
 .float friction;
 void SUB_Friction (entity this)
 {
 ==================
 */
 .float friction;
 void SUB_Friction (entity this)
 {
-       self.SUB_NEXTTHINK = time;
-       if(self.SUB_FLAGS & FL_ONGROUND)
-               self.SUB_VELOCITY = self.SUB_VELOCITY * (1 - frametime * self.friction);
+       this.SUB_NEXTTHINK = time;
+       if(this.SUB_FLAGS & FL_ONGROUND)
+               this.SUB_VELOCITY = this.SUB_VELOCITY * (1 - frametime * this.friction);
 }
 
 /*
 }
 
 /*
@@ -75,19 +75,19 @@ void SUB_SetFade (entity ent, float when, float fading_time)
 =============
 SUB_CalcMove
 
 =============
 SUB_CalcMove
 
-calculate self.SUB_VELOCITY and self.SUB_NEXTTHINK to reach dest from
-self.SUB_ORIGIN traveling at speed
+calculate this.SUB_VELOCITY and this.SUB_NEXTTHINK to reach dest from
+this.SUB_ORIGIN traveling at speed
 ===============
 */
 void SUB_CalcMoveDone(entity this)
 {
        // After moving, set origin to exact final destination
 
 ===============
 */
 void SUB_CalcMoveDone(entity this)
 {
        // After moving, set origin to exact final destination
 
-       SUB_SETORIGIN (self, self.finaldest);
-       self.SUB_VELOCITY = '0 0 0';
-       self.SUB_NEXTTHINK = -1;
-       if (self.think1)
-               self.think1 (self);
+       SUB_SETORIGIN (this, this.finaldest);
+       this.SUB_VELOCITY = '0 0 0';
+       this.SUB_NEXTTHINK = -1;
+       if (this.think1)
+               this.think1 (this);
 }
 
 .float platmovetype_turn;
 }
 
 .float platmovetype_turn;
@@ -101,19 +101,19 @@ void SUB_CalcMove_controller_think (entity this)
        vector veloc;
        vector angloc;
        vector nextpos;
        vector veloc;
        vector angloc;
        vector nextpos;
-       delta = self.destvec;
-       delta2 = self.destvec2;
-       if(time < self.animstate_endtime)
+       delta = this.destvec;
+       delta2 = this.destvec2;
+       if(time < this.animstate_endtime)
        {
                nexttick = time + PHYS_INPUT_FRAMETIME;
 
        {
                nexttick = time + PHYS_INPUT_FRAMETIME;
 
-               traveltime = self.animstate_endtime - self.animstate_starttime;
-               phasepos = (nexttick - self.animstate_starttime) / traveltime; // range: [0, 1]
-               phasepos = cubic_speedfunc(self.platmovetype_start, self.platmovetype_end, phasepos);
-               nextpos = self.origin + (delta * phasepos) + (delta2 * phasepos * phasepos);
+               traveltime = this.animstate_endtime - this.animstate_starttime;
+               phasepos = (nexttick - this.animstate_starttime) / traveltime; // range: [0, 1]
+               phasepos = cubic_speedfunc(this.platmovetype_start, this.platmovetype_end, phasepos);
+               nextpos = this.origin + (delta * phasepos) + (delta2 * phasepos * phasepos);
                // derivative: delta + 2 * delta2 * phasepos (e.g. for angle positioning)
 
                // derivative: delta + 2 * delta2 * phasepos (e.g. for angle positioning)
 
-               if(self.owner.platmovetype_turn)
+               if(this.owner.platmovetype_turn)
                {
                        vector destangle;
                        destangle = delta + 2 * delta2 * phasepos;
                {
                        vector destangle;
                        destangle = delta + 2 * delta2 * phasepos;
@@ -121,30 +121,30 @@ void SUB_CalcMove_controller_think (entity this)
                        destangle_x = -destangle_x; // flip up / down orientation
 
                        // take the shortest distance for the angles
                        destangle_x = -destangle_x; // flip up / down orientation
 
                        // take the shortest distance for the angles
-                       vector v = SUB_ANGLES(self.owner);
+                       vector v = SUB_ANGLES(this.owner);
                        v.x -= 360 * floor((v.x - destangle_x) / 360 + 0.5);
                        v.y -= 360 * floor((v.y - destangle_y) / 360 + 0.5);
                        v.z -= 360 * floor((v.z - destangle_z) / 360 + 0.5);
                        v.x -= 360 * floor((v.x - destangle_x) / 360 + 0.5);
                        v.y -= 360 * floor((v.y - destangle_y) / 360 + 0.5);
                        v.z -= 360 * floor((v.z - destangle_z) / 360 + 0.5);
-                       SUB_ANGLES(self.owner) = v;
-                       angloc = destangle - SUB_ANGLES(self.owner);
+                       SUB_ANGLES(this.owner) = v;
+                       angloc = destangle - SUB_ANGLES(this.owner);
                        angloc = angloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame
                        angloc = angloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame
-                       self.owner.SUB_AVELOCITY = angloc;
+                       this.owner.SUB_AVELOCITY = angloc;
                }
                }
-               if(nexttick < self.animstate_endtime)
-                       veloc = nextpos - self.owner.SUB_ORIGIN;
+               if(nexttick < this.animstate_endtime)
+                       veloc = nextpos - this.owner.SUB_ORIGIN;
                else
                else
-                       veloc = self.finaldest - self.owner.SUB_ORIGIN;
+                       veloc = this.finaldest - this.owner.SUB_ORIGIN;
                veloc = veloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame
 
                veloc = veloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame
 
-               self.owner.SUB_VELOCITY = veloc;
-               self.nextthink = nexttick;
+               this.owner.SUB_VELOCITY = veloc;
+               this.nextthink = nexttick;
        }
        else
        {
                // derivative: delta + 2 * delta2 (e.g. for angle positioning)
        }
        else
        {
                // derivative: delta + 2 * delta2 (e.g. for angle positioning)
-               entity own = self.owner;
-               SUB_THINK(own, self.think1);
-               remove(self);
+               entity own = this.owner;
+               SUB_THINK(own, this.think1);
+               remove(this);
                WITHSELF(own, SUB_THUNK(own)(own));
        }
 }
                WITHSELF(own, SUB_THUNK(own)(own));
        }
 }
@@ -191,21 +191,21 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
        if (!tspeed)
                objerror ("No speed is defined!");
 
        if (!tspeed)
                objerror ("No speed is defined!");
 
-       self.think1 = func;
-       self.finaldest = tdest;
-       SUB_THINK(self, SUB_CalcMoveDone);
+       this.think1 = func;
+       this.finaldest = tdest;
+       SUB_THINK(this, SUB_CalcMoveDone);
 
        switch(tspeedtype)
        {
                default:
                case TSPEED_START:
 
        switch(tspeedtype)
        {
                default:
                case TSPEED_START:
-                       traveltime = 2 * vlen(tcontrol - self.SUB_ORIGIN) / tspeed;
+                       traveltime = 2 * vlen(tcontrol - this.SUB_ORIGIN) / tspeed;
                        break;
                case TSPEED_END:
                        traveltime = 2 * vlen(tcontrol - tdest)       / tspeed;
                        break;
                case TSPEED_LINEAR:
                        break;
                case TSPEED_END:
                        traveltime = 2 * vlen(tcontrol - tdest)       / tspeed;
                        break;
                case TSPEED_LINEAR:
-                       traveltime = vlen(tdest - self.SUB_ORIGIN)        / tspeed;
+                       traveltime = vlen(tdest - this.SUB_ORIGIN)        / tspeed;
                        break;
                case TSPEED_TIME:
                        traveltime = tspeed;
                        break;
                case TSPEED_TIME:
                        traveltime = tspeed;
@@ -214,26 +214,26 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
 
        if (traveltime < 0.1) // useless anim
        {
 
        if (traveltime < 0.1) // useless anim
        {
-               self.SUB_VELOCITY = '0 0 0';
-               self.SUB_NEXTTHINK = self.SUB_LTIME + 0.1;
+               this.SUB_VELOCITY = '0 0 0';
+               this.SUB_NEXTTHINK = this.SUB_LTIME + 0.1;
                return;
        }
 
        controller = new(SUB_CalcMove_controller);
                return;
        }
 
        controller = new(SUB_CalcMove_controller);
-       controller.owner = self;
-       controller.platmovetype = self.platmovetype;
-       controller.platmovetype_start = self.platmovetype_start;
-       controller.platmovetype_end = self.platmovetype_end;
-       SUB_CalcMove_controller_setbezier(controller, self.SUB_ORIGIN, tcontrol, tdest);
+       controller.owner = this;
+       controller.platmovetype = this.platmovetype;
+       controller.platmovetype_start = this.platmovetype_start;
+       controller.platmovetype_end = this.platmovetype_end;
+       SUB_CalcMove_controller_setbezier(controller, this.SUB_ORIGIN, tcontrol, tdest);
        controller.finaldest = (tdest + '0 0 0.125'); // where do we want to end? Offset to overshoot a bit.
        controller.animstate_starttime = time;
        controller.animstate_endtime = time + traveltime;
        setthink(controller, SUB_CalcMove_controller_think);
        controller.finaldest = (tdest + '0 0 0.125'); // where do we want to end? Offset to overshoot a bit.
        controller.animstate_starttime = time;
        controller.animstate_endtime = time + traveltime;
        setthink(controller, SUB_CalcMove_controller_think);
-       controller.think1 = SUB_THUNK(self);
+       controller.think1 = SUB_THUNK(this);
 
        // the thinking is now done by the controller
 
        // the thinking is now done by the controller
-       SUB_THINK(self, SUB_NullThink); // for PushMove
-       self.SUB_NEXTTHINK = self.SUB_LTIME + traveltime;
+       SUB_THINK(this, SUB_NullThink); // for PushMove
+       this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
 
        // invoke controller
        WITHSELF(controller, getthink(controller)(controller));
 
        // invoke controller
        WITHSELF(controller, getthink(controller)(controller));
@@ -247,18 +247,18 @@ void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, vo
        if (!tspeed)
                objerror ("No speed is defined!");
 
        if (!tspeed)
                objerror ("No speed is defined!");
 
-       self.think1 = func;
-       self.finaldest = tdest;
-       SUB_THINK(self, SUB_CalcMoveDone);
+       this.think1 = func;
+       this.finaldest = tdest;
+       SUB_THINK(this, SUB_CalcMoveDone);
 
 
-       if (tdest == self.SUB_ORIGIN)
+       if (tdest == this.SUB_ORIGIN)
        {
        {
-               self.SUB_VELOCITY = '0 0 0';
-               self.SUB_NEXTTHINK = self.SUB_LTIME + 0.1;
+               this.SUB_VELOCITY = '0 0 0';
+               this.SUB_NEXTTHINK = this.SUB_LTIME + 0.1;
                return;
        }
 
                return;
        }
 
-       delta = tdest - self.SUB_ORIGIN;
+       delta = tdest - this.SUB_ORIGIN;
 
        switch(tspeedtype)
        {
 
        switch(tspeedtype)
        {
@@ -277,15 +277,15 @@ void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, vo
        // of controlled animation, so let's just use linear movement.
        // Alternatively entities can choose to specify non-controlled movement.
         // The only currently implemented alternative movement is linear (value 1)
        // of controlled animation, so let's just use linear movement.
        // Alternatively entities can choose to specify non-controlled movement.
         // The only currently implemented alternative movement is linear (value 1)
-       if (traveltime < 0.15 || (self.platmovetype_start == 1 && self.platmovetype_end == 1)) // is this correct?
+       if (traveltime < 0.15 || (this.platmovetype_start == 1 && this.platmovetype_end == 1)) // is this correct?
        {
        {
-               self.SUB_VELOCITY = delta * (1/traveltime);     // QuakeC doesn't allow vector/float division
-               self.SUB_NEXTTHINK = self.SUB_LTIME + traveltime;
+               this.SUB_VELOCITY = delta * (1/traveltime);     // QuakeC doesn't allow vector/float division
+               this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
                return;
        }
 
        // now just run like a bezier curve...
                return;
        }
 
        // now just run like a bezier curve...
-       SUB_CalcMove_Bezier(self, (self.SUB_ORIGIN + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
+       SUB_CalcMove_Bezier(this, (this.SUB_ORIGIN + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
 }
 
 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
 }
 
 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
@@ -297,20 +297,20 @@ void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed,
 =============
 SUB_CalcAngleMove
 
 =============
 SUB_CalcAngleMove
 
-calculate self.SUB_AVELOCITY and self.SUB_NEXTTHINK to reach destangle from
-self.angles rotating
+calculate this.SUB_AVELOCITY and this.SUB_NEXTTHINK to reach destangle from
+this.angles rotating
 
 
-The calling function should make sure self.SUB_THINK is valid
+The calling function should make sure this.SUB_THINK is valid
 ===============
 */
 void SUB_CalcAngleMoveDone(entity this)
 {
        // After rotating, set angle to exact final angle
 ===============
 */
 void SUB_CalcAngleMoveDone(entity this)
 {
        // After rotating, set angle to exact final angle
-       self.angles = self.finalangle;
-       self.SUB_AVELOCITY = '0 0 0';
-       self.SUB_NEXTTHINK = -1;
-       if (self.think1)
-               self.think1 (self);
+       this.angles = this.finalangle;
+       this.SUB_AVELOCITY = '0 0 0';
+       this.SUB_NEXTTHINK = -1;
+       if (this.think1)
+               this.think1 (this);
 }
 
 // FIXME: I fixed this function only for rotation around the main axes
 }
 
 // FIXME: I fixed this function only for rotation around the main axes
@@ -323,10 +323,10 @@ void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float t
                objerror ("No speed is defined!");
 
        // take the shortest distance for the angles
                objerror ("No speed is defined!");
 
        // take the shortest distance for the angles
-       self.angles_x -= 360 * floor((self.angles_x - destangle_x) / 360 + 0.5);
-       self.angles_y -= 360 * floor((self.angles_y - destangle_y) / 360 + 0.5);
-       self.angles_z -= 360 * floor((self.angles_z - destangle_z) / 360 + 0.5);
-       delta = destangle - self.angles;
+       this.angles_x -= 360 * floor((this.angles_x - destangle_x) / 360 + 0.5);
+       this.angles_y -= 360 * floor((this.angles_y - destangle_y) / 360 + 0.5);
+       this.angles_z -= 360 * floor((this.angles_z - destangle_z) / 360 + 0.5);
+       delta = destangle - this.angles;
 
        switch(tspeedtype)
        {
 
        switch(tspeedtype)
        {
@@ -341,19 +341,19 @@ void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float t
                        break;
        }
 
                        break;
        }
 
-       self.think1 = func;
-       self.finalangle = destangle;
-       SUB_THINK(self, SUB_CalcAngleMoveDone);
+       this.think1 = func;
+       this.finalangle = destangle;
+       SUB_THINK(this, SUB_CalcAngleMoveDone);
 
        if (traveltime < 0.1)
        {
 
        if (traveltime < 0.1)
        {
-               self.SUB_AVELOCITY = '0 0 0';
-               self.SUB_NEXTTHINK = self.SUB_LTIME + 0.1;
+               this.SUB_AVELOCITY = '0 0 0';
+               this.SUB_NEXTTHINK = this.SUB_LTIME + 0.1;
                return;
        }
 
                return;
        }
 
-       self.SUB_AVELOCITY = delta * (1 / traveltime);
-       self.SUB_NEXTTHINK = self.SUB_LTIME + traveltime;
+       this.SUB_AVELOCITY = delta * (1 / traveltime);
+       this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
 }
 
 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func)
 }
 
 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func)
index 94c15c17a416b74eacf09f4a0380407800f790dd..48330d46011007e72e5d32e592da91f8c0fa01eb 100644 (file)
@@ -254,18 +254,18 @@ void Net_TargetMusic()
 
 void Ent_TriggerMusic_Think(entity this)
 {
 
 void Ent_TriggerMusic_Think(entity this)
 {
-       if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, self, world))
+       if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, this, world))
        {
        {
-               music_trigger = self;
+               music_trigger = this;
        }
        }
-       self.nextthink = time;
+       this.nextthink = time;
 }
 
 void Ent_TriggerMusic_Remove(entity this)
 {
 }
 
 void Ent_TriggerMusic_Remove(entity this)
 {
-       if(self.noise)
-               strunzone(self.noise);
-       self.noise = string_null;
+       if(this.noise)
+               strunzone(this.noise);
+       this.noise = string_null;
 }
 
 NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew)
 }
 
 NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew)
index a7c0c93513a32bbb736c2040e03cf2910ba749be..a570c2a64454cb42abf8b10b934d057f36d723b6 100644 (file)
@@ -23,12 +23,12 @@ float target_spawn_count;
 
 void target_spawn_helper_setmodel(entity this)
 {
 
 void target_spawn_helper_setmodel(entity this)
 {
-       _setmodel(self, self.model);
+       _setmodel(this, this.model);
 }
 
 void target_spawn_helper_setsize(entity this)
 {
 }
 
 void target_spawn_helper_setsize(entity this)
 {
-       setsize(self, self.mins, self.maxs);
+       setsize(this, this.mins, this.maxs);
 }
 
 void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, entity t2, entity t3, entity t4, entity act, entity trigger)
 }
 
 void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, entity t2, entity t3, entity t4, entity act, entity trigger)
index 197ea9271be5cb4bb5140f4e1d460635e2117899..4472b572e5e7918bd67242e992fa002ac2f2e3ea 100644 (file)
@@ -15,20 +15,20 @@ void trigger_gravity_remove(entity own)
 void trigger_gravity_check_think(entity this)
 {
        // This spawns when a player enters the gravity zone and checks if he left.
 void trigger_gravity_check_think(entity this)
 {
        // This spawns when a player enters the gravity zone and checks if he left.
-       // Each frame, self.count is set to 2 by trigger_gravity_touch() and decreased by 1 here.
+       // Each frame, this.count is set to 2 by trigger_gravity_touch() and decreased by 1 here.
        // It the player has left the gravity trigger, this will be allowed to reach 0 and indicate that.
        // It the player has left the gravity trigger, this will be allowed to reach 0 and indicate that.
-       if(self.count <= 0)
+       if(this.count <= 0)
        {
        {
-               if(self.owner.trigger_gravity_check == self)
-                       trigger_gravity_remove(self.owner);
+               if(this.owner.trigger_gravity_check == this)
+                       trigger_gravity_remove(this.owner);
                else
                else
-                       remove(self);
+                       remove(this);
                return;
        }
        else
        {
                return;
        }
        else
        {
-               self.count -= 1;
-               self.nextthink = time;
+               this.count -= 1;
+               this.nextthink = time;
        }
 }
 
        }
 }
 
@@ -41,18 +41,18 @@ void trigger_gravity_touch(entity this)
 {
        float g;
 
 {
        float g;
 
-       if(self.state != true)
+       if(this.state != true)
                return;
 
        EXACTTRIGGER_TOUCH;
 
                return;
 
        EXACTTRIGGER_TOUCH;
 
-       g = self.gravity;
+       g = this.gravity;
 
 
-       if (!(self.spawnflags & 1))
+       if (!(this.spawnflags & 1))
        {
                if(other.trigger_gravity_check)
                {
        {
                if(other.trigger_gravity_check)
                {
-                       if(self == other.trigger_gravity_check.enemy)
+                       if(this == other.trigger_gravity_check.enemy)
                        {
                                // same?
                                other.trigger_gravity_check.count = 2; // gravity one more frame...
                        {
                                // same?
                                other.trigger_gravity_check.count = 2; // gravity one more frame...
@@ -60,13 +60,13 @@ void trigger_gravity_touch(entity this)
                        }
 
                        // compare prio
                        }
 
                        // compare prio
-                       if(self.cnt > other.trigger_gravity_check.enemy.cnt)
+                       if(this.cnt > other.trigger_gravity_check.enemy.cnt)
                                trigger_gravity_remove(other);
                        else
                                return;
                }
                other.trigger_gravity_check = spawn();
                                trigger_gravity_remove(other);
                        else
                                return;
                }
                other.trigger_gravity_check = spawn();
-               other.trigger_gravity_check.enemy = self;
+               other.trigger_gravity_check.enemy = this;
                other.trigger_gravity_check.owner = other;
                other.trigger_gravity_check.gravity = other.gravity;
                setthink(other.trigger_gravity_check, trigger_gravity_check_think);
                other.trigger_gravity_check.owner = other;
                other.trigger_gravity_check.gravity = other.gravity;
                setthink(other.trigger_gravity_check, trigger_gravity_check_think);
@@ -79,9 +79,9 @@ void trigger_gravity_touch(entity this)
        if (other.gravity != g)
        {
                other.gravity = g;
        if (other.gravity != g)
        {
                other.gravity = g;
-               if(self.noise != "")
-                       _sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
-               UpdateCSQCProjectile(self.owner);
+               if(this.noise != "")
+                       _sound (other, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
+               UpdateCSQCProjectile(this.owner);
        }
 }
 
        }
 }
 
index 25d824d7a62f0953dd6f5538a4bd1771cf565fb4..41519e20cc622c4547bae54d7c226cd147f17e0c 100644 (file)
@@ -2,7 +2,7 @@
 .float triggerhealtime;
 void trigger_heal_touch(entity this)
 {
 .float triggerhealtime;
 void trigger_heal_touch(entity this)
 {
-       if (self.active != ACTIVE_ACTIVE)
+       if (this.active != ACTIVE_ACTIVE)
                return;
 
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
                return;
 
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
@@ -15,11 +15,11 @@ void trigger_heal_touch(entity this)
                        EXACTTRIGGER_TOUCH;
                        other.triggerhealtime = time + 1;
 
                        EXACTTRIGGER_TOUCH;
                        other.triggerhealtime = time + 1;
 
-                       if (other.health < self.max_health)
+                       if (other.health < this.max_health)
                        {
                        {
-                               other.health = min(other.health + self.health, self.max_health);
+                               other.health = min(other.health + this.health, this.max_health);
                                other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
                                other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
-                               _sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
+                               _sound (other, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
                        }
                }
        }
                        }
                }
        }
index 82199a39311ec56ee18d3acdb2e718818afdb0ed..69653ad3cf1707c526f6574d0b30127c16971cb1 100644 (file)
@@ -10,11 +10,11 @@ void trigger_hurt_use(entity this, entity actor, entity trigger)
 .float triggerhurttime;
 void trigger_hurt_touch(entity this)
 {
 .float triggerhurttime;
 void trigger_hurt_touch(entity this)
 {
-       if (self.active != ACTIVE_ACTIVE)
+       if (this.active != ACTIVE_ACTIVE)
                return;
 
                return;
 
-       if(self.team)
-               if(((self.spawnflags & 4) == 0) == (self.team != other.team))
+       if(this.team)
+               if(((this.spawnflags & 4) == 0) == (this.team != other.team))
                        return;
 
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
                        return;
 
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
@@ -27,14 +27,14 @@ void trigger_hurt_touch(entity this)
                        other.triggerhurttime = time + 1;
 
                        entity own;
                        other.triggerhurttime = time + 1;
 
                        entity own;
-                       own = self.enemy;
+                       own = this.enemy;
                        if (!IS_PLAYER(own))
                        {
                        if (!IS_PLAYER(own))
                        {
-                               own = self;
-                               self.enemy = world; // I still hate you all
+                               own = this;
+                               this.enemy = world; // I still hate you all
                        }
 
                        }
 
-                       Damage (other, self, own, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       Damage (other, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
        }
        else if(other.damagedbytriggers)
                }
        }
        else if(other.damagedbytriggers)
@@ -42,7 +42,7 @@ void trigger_hurt_touch(entity this)
                if(other.takedamage)
                {
                        EXACTTRIGGER_TOUCH;
                if(other.takedamage)
                {
                        EXACTTRIGGER_TOUCH;
-                       Damage(other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       Damage(other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
        }
 
                }
        }
 
index d45a82b53c41dc2450710f8bc2d3397ea4fbaadd..c174aa513d8c3990ea0269e0293f4b59b9e7a502 100644 (file)
@@ -5,7 +5,7 @@ void trigger_impulse_touch1(entity this)
        float pushdeltatime;
        float str;
 
        float pushdeltatime;
        float str;
 
-       if (self.active != ACTIVE_ACTIVE)
+       if (this.active != ACTIVE_ACTIVE)
                return;
 
        if (!isPushable(other))
                return;
 
        if (!isPushable(other))
@@ -13,55 +13,55 @@ void trigger_impulse_touch1(entity this)
 
        EXACTTRIGGER_TOUCH;
 
 
        EXACTTRIGGER_TOUCH;
 
-       targ = find(world, targetname, self.target);
+       targ = find(world, targetname, this.target);
        if(!targ)
        {
                objerror("trigger_force without a (valid) .target!\n");
        if(!targ)
        {
                objerror("trigger_force without a (valid) .target!\n");
-               remove(self);
+               remove(this);
                return;
        }
 
 #ifdef SVQC
                return;
        }
 
 #ifdef SVQC
-       str = min(self.radius, vlen(self.origin - other.origin));
+       str = min(this.radius, vlen(this.origin - other.origin));
 #elif defined(CSQC)
 #elif defined(CSQC)
-       str = min(self.radius, vlen(self.origin - other.move_origin));
+       str = min(this.radius, vlen(this.origin - other.move_origin));
 #endif
 
 #endif
 
-       if(self.falloff == 1)
-               str = (str / self.radius) * self.strength;
-       else if(self.falloff == 2)
-               str = (1 - (str / self.radius)) * self.strength;
+       if(this.falloff == 1)
+               str = (str / this.radius) * this.strength;
+       else if(this.falloff == 2)
+               str = (1 - (str / this.radius)) * this.strength;
        else
        else
-               str = self.strength;
+               str = this.strength;
 
        pushdeltatime = time - other.lastpushtime;
        if (pushdeltatime > 0.15) pushdeltatime = 0;
        other.lastpushtime = time;
        if(!pushdeltatime) return;
 
 
        pushdeltatime = time - other.lastpushtime;
        if (pushdeltatime > 0.15) pushdeltatime = 0;
        other.lastpushtime = time;
        if(!pushdeltatime) return;
 
-       if(self.spawnflags & 64)
+       if(this.spawnflags & 64)
        {
 #ifdef SVQC
        {
 #ifdef SVQC
-               float addspeed = str - other.velocity * normalize(targ.origin - self.origin);
+               float addspeed = str - other.velocity * normalize(targ.origin - this.origin);
                if (addspeed > 0)
                {
                        float accelspeed = min(8 * pushdeltatime * str, addspeed);
                if (addspeed > 0)
                {
                        float accelspeed = min(8 * pushdeltatime * str, addspeed);
-                       other.velocity += accelspeed * normalize(targ.origin - self.origin);
+                       other.velocity += accelspeed * normalize(targ.origin - this.origin);
                }
 #elif defined(CSQC)
                }
 #elif defined(CSQC)
-               float addspeed = str - other.move_velocity * normalize(targ.origin - self.origin);
+               float addspeed = str - other.move_velocity * normalize(targ.origin - this.origin);
                if (addspeed > 0)
                {
                        float accelspeed = min(8 * pushdeltatime * str, addspeed);
                if (addspeed > 0)
                {
                        float accelspeed = min(8 * pushdeltatime * str, addspeed);
-                       other.move_velocity += accelspeed * normalize(targ.origin - self.origin);
+                       other.move_velocity += accelspeed * normalize(targ.origin - this.origin);
                }
 #endif
        }
        else
 #ifdef SVQC
                }
 #endif
        }
        else
 #ifdef SVQC
-               other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
+               other.velocity = other.velocity + normalize(targ.origin - this.origin) * str * pushdeltatime;
 #elif defined(CSQC)
 #elif defined(CSQC)
-               other.move_velocity = other.move_velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
+               other.move_velocity = other.move_velocity + normalize(targ.origin - this.origin) * str * pushdeltatime;
 #endif
 
 #ifdef SVQC
 #endif
 
 #ifdef SVQC
@@ -78,7 +78,7 @@ void trigger_impulse_touch2(entity this)
 {
        float pushdeltatime;
 
 {
        float pushdeltatime;
 
-       if (self.active != ACTIVE_ACTIVE)
+       if (this.active != ACTIVE_ACTIVE)
                return;
 
        if (!isPushable(other))
                return;
 
        if (!isPushable(other))
@@ -93,11 +93,11 @@ void trigger_impulse_touch2(entity this)
 
        // div0: ticrate independent, 1 = identity (not 20)
 #ifdef SVQC
 
        // div0: ticrate independent, 1 = identity (not 20)
 #ifdef SVQC
-       other.velocity = other.velocity * pow(self.strength, pushdeltatime);
+       other.velocity = other.velocity * pow(this.strength, pushdeltatime);
 
        UpdateCSQCProjectile(other);
 #elif defined(CSQC)
 
        UpdateCSQCProjectile(other);
 #elif defined(CSQC)
-       other.move_velocity = other.move_velocity * pow(self.strength, pushdeltatime);
+       other.move_velocity = other.move_velocity * pow(this.strength, pushdeltatime);
 #endif
 }
 
 #endif
 }
 
@@ -107,7 +107,7 @@ void trigger_impulse_touch3(entity this)
        float pushdeltatime;
        float str;
 
        float pushdeltatime;
        float str;
 
-       if (self.active != ACTIVE_ACTIVE)
+       if (this.active != ACTIVE_ACTIVE)
                return;
 
        if (!isPushable(other))
                return;
 
        if (!isPushable(other))
@@ -120,27 +120,27 @@ void trigger_impulse_touch3(entity this)
        other.lastpushtime = time;
        if(!pushdeltatime) return;
 
        other.lastpushtime = time;
        if(!pushdeltatime) return;
 
-       setsize(self, '-1 -1 -1' * self.radius,'1 1 1' * self.radius);
+       setsize(this, '-1 -1 -1' * this.radius,'1 1 1' * this.radius);
 
 #ifdef SVQC
 
 #ifdef SVQC
-       str = min(self.radius, vlen(self.origin - other.origin));
+       str = min(this.radius, vlen(this.origin - other.origin));
 #elif defined(CSQC)
 #elif defined(CSQC)
-       str = min(self.radius, vlen(self.origin - other.move_origin));
+       str = min(this.radius, vlen(this.origin - other.move_origin));
 #endif
 
 #endif
 
-       if(self.falloff == 1)
-               str = (1 - str / self.radius) * self.strength; // 1 in the inside
-       else if(self.falloff == 2)
-               str = (str / self.radius) * self.strength; // 0 in the inside
+       if(this.falloff == 1)
+               str = (1 - str / this.radius) * this.strength; // 1 in the inside
+       else if(this.falloff == 2)
+               str = (str / this.radius) * this.strength; // 0 in the inside
        else
        else
-               str = self.strength;
+               str = this.strength;
 
 #ifdef SVQC
 
 #ifdef SVQC
-       other.velocity = other.velocity + normalize(other.origin - self.origin) * str * pushdeltatime;
+       other.velocity = other.velocity + normalize(other.origin - this.origin) * str * pushdeltatime;
 
        UpdateCSQCProjectile(other);
 #elif defined(CSQC)
 
        UpdateCSQCProjectile(other);
 #elif defined(CSQC)
-       other.move_velocity = other.move_velocity + normalize(other.move_origin - self.origin) * str * pushdeltatime;
+       other.move_velocity = other.move_velocity + normalize(other.move_origin - this.origin) * str * pushdeltatime;
 #endif
 }
 
 #endif
 }
 
index e90eb1853affc2dc4e51097b1889980af8f07853..c8ff29cb7b4542b3f8add136b222f1bdd0b9df0a 100644 (file)
@@ -28,53 +28,53 @@ void trigger_keylock_touch(entity this)
                return;
 
        // check silver key
                return;
 
        // check silver key
-       if(self.itemkeys)
-               key_used = item_keys_usekey(self, other);
+       if(this.itemkeys)
+               key_used = item_keys_usekey(this, other);
 
 
-       if(self.itemkeys)
+       if(this.itemkeys)
        {
 #ifdef SVQC
                // at least one of the keys is missing
                if(key_used)
                {
                        // one or more keys were given, but others are still missing!
        {
 #ifdef SVQC
                // at least one of the keys is missing
                if(key_used)
                {
                        // one or more keys were given, but others are still missing!
-                       play2(other, self.noise1);
-                       Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_ALSONEED, item_keys_keylist(self.itemkeys));
+                       play2(other, this.noise1);
+                       Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_ALSONEED, item_keys_keylist(this.itemkeys));
                        other.key_door_messagetime = time + 2;
                }
                else if(other.key_door_messagetime <= time)
                {
                        // no keys were given
                        other.key_door_messagetime = time + 2;
                }
                else if(other.key_door_messagetime <= time)
                {
                        // no keys were given
-                       play2(other, self.noise2);
-                       Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_NEED, item_keys_keylist(self.itemkeys));
+                       play2(other, this.noise2);
+                       Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_NEED, item_keys_keylist(this.itemkeys));
                        other.key_door_messagetime = time + 2;
                }
 #endif
 
                // trigger target2
                        other.key_door_messagetime = time + 2;
                }
 #endif
 
                // trigger target2
-               if(self.delay <= time || started_delay == true)
-               if(self.target2)
+               if(this.delay <= time || started_delay == true)
+               if(this.target2)
                {
                {
-                       trigger_keylock_trigger(this, other, self.target2);
+                       trigger_keylock_trigger(this, other, this.target2);
                        started_delay = true;
                        started_delay = true;
-                       self.delay = time + self.wait;
+                       this.delay = time + this.wait;
                }
        }
        else
        {
 #ifdef SVQC
                // all keys were given!
                }
        }
        else
        {
 #ifdef SVQC
                // all keys were given!
-               play2(other, self.noise);
-               centerprint(other, self.message);
+               play2(other, this.noise);
+               centerprint(other, this.message);
 #endif
 
 #endif
 
-               if(self.target)
-                       trigger_keylock_trigger(this, other, self.target);
+               if(this.target)
+                       trigger_keylock_trigger(this, other, this.target);
 
 
-               if(self.killtarget)
-                       trigger_keylock_kill(self.killtarget);
+               if(this.killtarget)
+                       trigger_keylock_kill(this.killtarget);
 
 
-               remove(self);
+               remove(this);
        }
 
 }
        }
 
 }
index 435255727e7f4139e83baebe29266bdf8291f827..539c3f0650153947ea6ce635ec34c4fa0dadf526 100644 (file)
@@ -68,33 +68,33 @@ void multi_use(entity this, entity actor, entity trigger)
 
 void multi_touch(entity this)
 {
 
 void multi_touch(entity this)
 {
-       if(!(self.spawnflags & 2))
+       if(!(this.spawnflags & 2))
        if(!other.iscreature)
                        return;
 
        if(!other.iscreature)
                        return;
 
-       if(self.team)
-               if(((self.spawnflags & 4) == 0) == (self.team != other.team))
+       if(this.team)
+               if(((this.spawnflags & 4) == 0) == (this.team != other.team))
                        return;
 
 // if the trigger has an angles field, check player's facing direction
                        return;
 
 // if the trigger has an angles field, check player's facing direction
-       if (self.movedir != '0 0 0')
+       if (this.movedir != '0 0 0')
        {
                makevectors (other.angles);
        {
                makevectors (other.angles);
-               if (v_forward * self.movedir < 0)
+               if (v_forward * this.movedir < 0)
                        return;         // not facing the right way
        }
 
        // if the trigger has pressed keys, check that the player is pressing those keys
                        return;         // not facing the right way
        }
 
        // if the trigger has pressed keys, check that the player is pressing those keys
-       if(self.pressedkeys)
+       if(this.pressedkeys)
        if(IS_PLAYER(other)) // only for players
        if(IS_PLAYER(other)) // only for players
-       if(!(other.pressedkeys & self.pressedkeys))
+       if(!(other.pressedkeys & this.pressedkeys))
                return;
 
        EXACTTRIGGER_TOUCH;
 
                return;
 
        EXACTTRIGGER_TOUCH;
 
-       self.enemy = other;
-       self.goalentity = other;
-       multi_trigger(self);
+       this.enemy = other;
+       this.goalentity = other;
+       multi_trigger(this);
 }
 
 void multi_eventdamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 }
 
 void multi_eventdamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
index 5707a0ac3a10a12301e9aae49302c506f0a603b5..bf4178beae33396b3742a6bedabe5f950cc0d21d 100644 (file)
@@ -29,12 +29,12 @@ void trigger_secret_touch(entity this)
        //print(ftos(secret_counter.count), "\n");
 
        // centerprint message (multi_touch() doesn't always call centerprint())
        //print(ftos(secret_counter.count), "\n");
 
        // centerprint message (multi_touch() doesn't always call centerprint())
-       centerprint(other, self.message);
-       self.message = "";
+       centerprint(other, this.message);
+       this.message = "";
 
        // handle normal trigger features
 
        // handle normal trigger features
-       multi_touch(self);
-       remove(self);
+       multi_touch(this);
+       remove(this);
 }
 
 /*QUAKED trigger_secret (.5 .5 .5) ?
 }
 
 /*QUAKED trigger_secret (.5 .5 .5) ?
index 3a1cf9530b0c44ceed0c5b797f27ae4e38b5ea62..fb792b94bb926bdec1cd410746dd62fe94837471 100644 (file)
@@ -39,14 +39,14 @@ void swampslug_think(entity this);
 void swampslug_think(entity this)
 {
        //Slowly kill the slug
 void swampslug_think(entity this)
 {
        //Slowly kill the slug
-       self.health = self.health - 1;
+       this.health = this.health - 1;
 
        //Slug dead? then remove curses.
 
        //Slug dead? then remove curses.
-       if(self.health <= 0)
+       if(this.health <= 0)
        {
        {
-               self.owner.in_swamp = 0;
-               remove(self);
-               //centerprint(self.owner,"Killing slug...\n");
+               this.owner.in_swamp = 0;
+               remove(this);
+               //centerprint(this.owner,"Killing slug...\n");
                return;
        }
 
                return;
        }
 
@@ -54,10 +54,10 @@ void swampslug_think(entity this)
        // Or we have exited it very recently.
        // Do the damage and renew the timer.
 #ifdef SVQC
        // Or we have exited it very recently.
        // Do the damage and renew the timer.
 #ifdef SVQC
-       Damage (self.owner, self, self, self.dmg, DEATH_SWAMP.m_id, other.origin, '0 0 0');
+       Damage (this.owner, this, this, this.dmg, DEATH_SWAMP.m_id, other.origin, '0 0 0');
 #endif
 
 #endif
 
-       self.nextthink = time + self.swamp_interval;
+       this.nextthink = time + this.swamp_interval;
 }
 
 void swamp_touch(entity this)
 }
 
 void swamp_touch(entity this)
@@ -79,9 +79,9 @@ void swamp_touch(entity this)
                setthink(other.swampslug, swampslug_think);
                other.swampslug.nextthink = time;
                other.swampslug.owner = other;
                setthink(other.swampslug, swampslug_think);
                other.swampslug.nextthink = time;
                other.swampslug.owner = other;
-               other.swampslug.dmg = self.dmg;
-               other.swampslug.swamp_interval = self.swamp_interval;
-               other.swamp_slowdown = self.swamp_slowdown;
+               other.swampslug.dmg = this.dmg;
+               other.swampslug.swamp_interval = this.swamp_interval;
+               other.swamp_slowdown = this.swamp_slowdown;
                other.in_swamp = 1;
                return;
        }
                other.in_swamp = 1;
                return;
        }
index 54777b75cb1aa57723aa5d0c4d90c6556bdcaeb7..8caa2d5ebe33bb1422bc06a3d267525a1fc5f53c 100644 (file)
@@ -13,7 +13,7 @@ void trigger_teleport_use(entity this, entity actor, entity trigger)
 
 void Teleport_Touch (entity this)
 {
 
 void Teleport_Touch (entity this)
 {
-       if (self.active != ACTIVE_ACTIVE)
+       if (this.active != ACTIVE_ACTIVE)
                return;
 
 #ifdef SVQC
                return;
 
 #ifdef SVQC
@@ -34,8 +34,8 @@ void Teleport_Touch (entity this)
        if(IS_DEAD(other))
                return;
 
        if(IS_DEAD(other))
                return;
 
-       if(self.team)
-               if(((self.spawnflags & 4) == 0) == (DIFF_TEAM(this, other)))
+       if(this.team)
+               if(((this.spawnflags & 4) == 0) == (DIFF_TEAM(this, other)))
                        return;
 
        EXACTTRIGGER_TOUCH;
                        return;
 
        EXACTTRIGGER_TOUCH;
@@ -46,12 +46,12 @@ void Teleport_Touch (entity this)
 #endif
 
        entity e;
 #endif
 
        entity e;
-       e = Simple_TeleportPlayer(self, other);
+       e = Simple_TeleportPlayer(this, other);
 
 #ifdef SVQC
 
 #ifdef SVQC
-       string s = self.target; self.target = string_null;
-       SUB_UseTargets(self, other, other); // TODO: should we be using other for trigger too?
-       if (!self.target) self.target = s;
+       string s = this.target; this.target = string_null;
+       SUB_UseTargets(this, other, other); // TODO: should we be using other for trigger too?
+       if (!this.target) this.target = s;
 
        SUB_UseTargets(e, other, other);
 #endif
 
        SUB_UseTargets(e, other, other);
 #endif
index d65fe953f39d2de0bd015d6ed74f747e53f5591c..9e4ab50682da3f8f9b35730fdc0dd479d376279c 100644 (file)
@@ -17,27 +17,27 @@ void viewloc_think(entity this)
        // we abuse this method, rather than using normal .touch, because touch isn't reliable with multiple clients inside the same trigger, and can't "untouch" entities
 
        // set myself as current viewloc where possible
        // we abuse this method, rather than using normal .touch, because touch isn't reliable with multiple clients inside the same trigger, and can't "untouch" entities
 
        // set myself as current viewloc where possible
-       for(e = world; (e = findentity(e, viewloc, self)); )
+       for(e = world; (e = findentity(e, viewloc, this)); )
                e.viewloc = world;
 
                e.viewloc = world;
 
-               for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain)
+               for(e = findradius((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1); e; e = e.chain)
                        if(!e.viewloc)
                                if(IS_PLAYER(e)) // should we support non-player entities with this?
                                //if(!IS_DEAD(e)) // death view is handled separately, we can't override this just yet
                                {
                                        vector emin = e.absmin;
                                        vector emax = e.absmax;
                        if(!e.viewloc)
                                if(IS_PLAYER(e)) // should we support non-player entities with this?
                                //if(!IS_DEAD(e)) // death view is handled separately, we can't override this just yet
                                {
                                        vector emin = e.absmin;
                                        vector emax = e.absmax;
-                                       if(self.solid == SOLID_BSP)
+                                       if(this.solid == SOLID_BSP)
                                        {
                                                emin -= '1 1 1';
                                                emax += '1 1 1';
                                        }
                                        {
                                                emin -= '1 1 1';
                                                emax += '1 1 1';
                                        }
-                                       if(boxesoverlap(emin, emax, self.absmin, self.absmax)) // quick
-                                               if(WarpZoneLib_BoxTouchesBrush(emin, emax, self, e)) // accurate
-                                                       e.viewloc = self;
+                                       if(boxesoverlap(emin, emax, this.absmin, this.absmax)) // quick
+                                               if(WarpZoneLib_BoxTouchesBrush(emin, emax, this, e)) // accurate
+                                                       e.viewloc = this;
                                }
 
                                }
 
-       self.nextthink = time;
+       this.nextthink = time;
 }
 
 bool trigger_viewloc_send(entity this, entity to, int sf)
 }
 
 bool trigger_viewloc_send(entity this, entity to, int sf)
@@ -136,8 +136,8 @@ spawnfunc(target_viewlocation) { spawnfunc_target_viewlocation_start(this); }
 
 void trigger_viewloc_updatelink(entity this)
 {
 
 void trigger_viewloc_updatelink(entity this)
 {
-       self.enemy = findfloat(world, entnum, self.cnt);
-       self.goalentity = findfloat(world, entnum, self.count);
+       this.enemy = findfloat(world, entnum, this.cnt);
+       this.goalentity = findfloat(world, entnum, this.count);
 }
 
 NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew)
 }
 
 NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew)
index d9c6a08126a90672e85be1966b31144faeba8ef2..d7d988f516172fd1b637ba5a416afc08f8e6aa05 100644 (file)
@@ -170,16 +170,16 @@ SUB_UseTargets
 
 the global "activator" should be set to the entity that initiated the firing.
 
 
 the global "activator" should be set to the entity that initiated the firing.
 
-If self.delay is set, a DelayedUse entity will be created that will actually
+If this.delay is set, a DelayedUse entity will be created that will actually
 do the SUB_UseTargets after that many seconds have passed.
 
 do the SUB_UseTargets after that many seconds have passed.
 
-Centerprints any self.message to the activator.
+Centerprints any this.message to the activator.
 
 
-Removes all entities with a targetname that match self.killtarget,
+Removes all entities with a targetname that match this.killtarget,
 and removes them, so some events can remove other triggers.
 
 Search for (string)targetname in all entities that
 and removes them, so some events can remove other triggers.
 
 Search for (string)targetname in all entities that
-match (string)self.target and call their .use function
+match (string)this.target and call their .use function
 
 ==============================
 */
 
 ==============================
 */
index 5e24781e696faa23ef56148cd848e746d0f341f5..82c0916c19228c2dd6605b24a6f503d6b3c07061 100644 (file)
@@ -16,7 +16,7 @@ const float   SPAWNFLAG_NOTOUCH = 1;
 .float height;
 
 .float nottargeted;
 .float height;
 
 .float nottargeted;
-#define IFTARGETED if(!self.nottargeted && self.targetname != "")
+#define IFTARGETED if(!this.nottargeted && this.targetname != "")
 
 .float lip;
 
 
 .float lip;
 
index a5e758e0eed25b555c751f7c9823d75cc5500538..46526df4d615db53dc99f2391b2abc07d24f7805 100644 (file)
 /*
 entity path_makeorcache(entity forwho,entity start, entity end)
 {
 /*
 entity path_makeorcache(entity forwho,entity start, entity end)
 {
-    entity oldself;
     entity pth;
     entity pth;
-    oldself = self;
-    self = forwho;
 
 
-    //pth = pathlib_makepath(start.origin,end.origin,PFL_GROUNDSNAP,500,1.5,PT_QUICKSTAR);
+    //pth = pathlib_makepath(forwho, start.origin,end.origin,PFL_GROUNDSNAP,500,1.5,PT_QUICKSTAR);
 
 
-    self = oldself;
     return pth;
 }
 */
     return pth;
 }
 */
index 63b30bc355cf021a411571a0e84a45d38b464ed3..347a5ff838ff3ee6fefb13d59d70e5e2051d72e9 100644 (file)
@@ -316,41 +316,41 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
 
 void turret_die(entity this)
 {
 
 void turret_die(entity this)
 {
-       sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-       pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
+       sound (this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+       pointparticles(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1);
        if (!autocvar_cl_nogibs)
        {
                // Base
        if (!autocvar_cl_nogibs)
        {
                // Base
-               if(self.m_id == TUR_EWHEEL.m_id)
-                       turret_gibtoss((get_turretinfo(self.m_id)).model, self.origin + '0 0 18', self.velocity + '0 0 400' + '0.1 0.1 1' * (random() * 400), '-1 -1 -1', true);
-               else if (self.m_id == TUR_WALKER.m_id)
-                       turret_gibtoss((get_turretinfo(self.m_id)).model, self.origin + '0 0 18', self.velocity + '0 0 300' + '0.1 0.1 1' * (random() * 200), '-1 -1 -1', true);
-               else if (self.m_id == TUR_TESLA.m_id)
-                       turret_gibtoss((get_turretinfo(self.m_id)).model, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', false);
+               if(this.m_id == TUR_EWHEEL.m_id)
+                       turret_gibtoss((get_turretinfo(this.m_id)).model, this.origin + '0 0 18', this.velocity + '0 0 400' + '0.1 0.1 1' * (random() * 400), '-1 -1 -1', true);
+               else if (this.m_id == TUR_WALKER.m_id)
+                       turret_gibtoss((get_turretinfo(this.m_id)).model, this.origin + '0 0 18', this.velocity + '0 0 300' + '0.1 0.1 1' * (random() * 200), '-1 -1 -1', true);
+               else if (this.m_id == TUR_TESLA.m_id)
+                       turret_gibtoss((get_turretinfo(this.m_id)).model, this.origin + '0 0 18', '0 0 200', '-1 -1 -1', false);
                else
                {
                        if (random() > 0.5)
                        {
                else
                {
                        if (random() > 0.5)
                        {
-                               turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
-                               turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
-                               turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
+                               turret_gibtoss("models/turrets/base-gib2.md3", this.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
+                               turret_gibtoss("models/turrets/base-gib3.md3", this.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
+                               turret_gibtoss("models/turrets/base-gib4.md3", this.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', false);
                        }
                        else
                        }
                        else
-                               turret_gibtoss("models/turrets/base-gib1.md3", self.origin + '0 0 8', '0 0 0', '0 0 0', true);
+                               turret_gibtoss("models/turrets/base-gib1.md3", this.origin + '0 0 8', '0 0 0', '0 0 0', true);
 
 
-                       entity headgib = turret_gibtoss((get_turretinfo(self.m_id)).head_model, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', true);
+                       entity headgib = turret_gibtoss((get_turretinfo(this.m_id)).head_model, this.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', true);
                        if(headgib)
                        {
                        if(headgib)
                        {
-                               headgib.angles = headgib.move_angles = self.tur_head.angles;
-                               headgib.avelocity = headgib.move_avelocity = self.tur_head.move_avelocity + randomvec() * 45;
+                               headgib.angles = headgib.move_angles = this.tur_head.angles;
+                               headgib.avelocity = headgib.move_avelocity = this.tur_head.move_avelocity + randomvec() * 45;
                                headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5;
                                headgib.gravity = 0.5;
                        }
                }
        }
 
                                headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5;
                                headgib.gravity = 0.5;
                        }
                }
        }
 
-       setmodel(self, MDL_Null);
-       setmodel(self.tur_head, MDL_Null);
+       setmodel(this, MDL_Null);
+       setmodel(this.tur_head, MDL_Null);
 }
 
 NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
 }
 
 NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
index de6ff767e523e7a940a862a00bc7d819c8ef5795..1c87cbb45206968fd199ec29af39b2e961b0e8c1 100644 (file)
@@ -166,44 +166,44 @@ float turret_targetscore_generic(entity _turret, entity _target)
 // Generic damage handling
 void turret_hide(entity this)
 {
 // Generic damage handling
 void turret_hide(entity this)
 {
-       self.effects   |= EF_NODRAW;
-       self.nextthink = time + self.respawntime - 0.2;
-       setthink(self, turret_respawn);
+       this.effects   |= EF_NODRAW;
+       this.nextthink = time + this.respawntime - 0.2;
+       setthink(this, turret_respawn);
 }
 
 void turret_die(entity this)
 {
 }
 
 void turret_die(entity this)
 {
-       self.deadflag             = DEAD_DEAD;
-       self.tur_head.deadflag = self.deadflag;
+       this.deadflag             = DEAD_DEAD;
+       this.tur_head.deadflag = this.deadflag;
 
 // Unsolidify and hide real parts
 
 // Unsolidify and hide real parts
-       self.solid                       = SOLID_NOT;
-       self.tur_head.solid      = self.solid;
+       this.solid                       = SOLID_NOT;
+       this.tur_head.solid      = this.solid;
 
 
-       self.event_damage                 = func_null;
-       self.takedamage                  = DAMAGE_NO;
+       this.event_damage                 = func_null;
+       this.takedamage                  = DAMAGE_NO;
 
 
-       self.health                      = 0;
+       this.health                      = 0;
 
 // Go boom
 
 // Go boom
-       //RadiusDamage (self,self, min(self.ammo,50),min(self.ammo,50) * 0.25,250,world,min(self.ammo,50)*5,DEATH_TURRET,world);
+       //RadiusDamage (this,this, min(this.ammo,50),min(this.ammo,50) * 0.25,250,world,min(this.ammo,50)*5,DEATH_TURRET,world);
 
 
-       Turret tur = get_turretinfo(self.m_id);
-       if(self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
+       Turret tur = get_turretinfo(this.m_id);
+       if(this.damage_flags & TFL_DMG_DEATH_NORESPAWN)
        {
        {
-               tur.tr_death(tur, self);
+               tur.tr_death(tur, this);
 
 
-               remove(self.tur_head);
-               remove(self);
+               remove(this.tur_head);
+               remove(this);
        }
        else
        {
                // Setup respawn
        }
        else
        {
                // Setup respawn
-               self.SendFlags    |= TNSF_STATUS;
-               self.nextthink   = time + 0.2;
-               setthink(self, turret_hide);
+               this.SendFlags    |= TNSF_STATUS;
+               this.nextthink   = time + 0.2;
+               setthink(this, turret_hide);
 
 
-               tur.tr_death(tur, self);
+               tur.tr_death(tur, this);
        }
 }
 
        }
 }
 
@@ -256,28 +256,28 @@ void turret_respawn(entity this)
 {
        // Make sure all parts belong to the same team since
        // this function doubles as "teamchange" function.
 {
        // Make sure all parts belong to the same team since
        // this function doubles as "teamchange" function.
-       self.tur_head.team      = self.team;
-       self.effects                       &= ~EF_NODRAW;
-       self.deadflag                           = DEAD_NO;
-       self.effects                            = EF_LOWPRECISION;
-       self.solid                                      = SOLID_BBOX;
-       self.takedamage                         = DAMAGE_AIM;
-       self.event_damage                       = turret_damage;
-       self.avelocity                          = '0 0 0';
-       self.tur_head.avelocity         = self.avelocity;
-       self.tur_head.angles            = self.idle_aim;
-       self.health                                     = self.max_health;
-       self.enemy                                      = world;
-       self.volly_counter                      = self.shot_volly;
-       self.ammo                                       = self.ammo_max;
-
-       self.nextthink = time + self.ticrate;
-       setthink(self, turret_think);
-
-       self.SendFlags = TNSF_FULL_UPDATE;
-
-       Turret tur = get_turretinfo(self.m_id);
-       tur.tr_setup(tur, self);
+       this.tur_head.team      = this.team;
+       this.effects                       &= ~EF_NODRAW;
+       this.deadflag                           = DEAD_NO;
+       this.effects                            = EF_LOWPRECISION;
+       this.solid                                      = SOLID_BBOX;
+       this.takedamage                         = DAMAGE_AIM;
+       this.event_damage                       = turret_damage;
+       this.avelocity                          = '0 0 0';
+       this.tur_head.avelocity         = this.avelocity;
+       this.tur_head.angles            = this.idle_aim;
+       this.health                                     = this.max_health;
+       this.enemy                                      = world;
+       this.volly_counter                      = this.shot_volly;
+       this.ammo                                       = this.ammo_max;
+
+       this.nextthink = time + this.ticrate;
+       setthink(this, turret_think);
+
+       this.SendFlags = TNSF_FULL_UPDATE;
+
+       Turret tur = get_turretinfo(this.m_id);
+       tur.tr_setup(tur, this);
 }
 
 
 }
 
 
@@ -306,55 +306,55 @@ bool turret_send(entity this, entity to, float sf)
        WriteByte(MSG_ENTITY, sf);
        if(sf & TNSF_SETUP)
        {
        WriteByte(MSG_ENTITY, sf);
        if(sf & TNSF_SETUP)
        {
-               WriteByte(MSG_ENTITY, self.m_id);
+               WriteByte(MSG_ENTITY, this.m_id);
 
 
-               WriteCoord(MSG_ENTITY, self.origin_x);
-               WriteCoord(MSG_ENTITY, self.origin_y);
-               WriteCoord(MSG_ENTITY, self.origin_z);
+               WriteCoord(MSG_ENTITY, this.origin_x);
+               WriteCoord(MSG_ENTITY, this.origin_y);
+               WriteCoord(MSG_ENTITY, this.origin_z);
 
 
-               WriteAngle(MSG_ENTITY, self.angles_x);
-               WriteAngle(MSG_ENTITY, self.angles_y);
+               WriteAngle(MSG_ENTITY, this.angles_x);
+               WriteAngle(MSG_ENTITY, this.angles_y);
        }
 
        if(sf & TNSF_ANG)
        {
        }
 
        if(sf & TNSF_ANG)
        {
-               WriteShort(MSG_ENTITY, rint(self.tur_head.angles_x));
-               WriteShort(MSG_ENTITY, rint(self.tur_head.angles_y));
+               WriteShort(MSG_ENTITY, rint(this.tur_head.angles_x));
+               WriteShort(MSG_ENTITY, rint(this.tur_head.angles_y));
        }
 
        if(sf & TNSF_AVEL)
        {
        }
 
        if(sf & TNSF_AVEL)
        {
-               WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_x));
-               WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_y));
+               WriteShort(MSG_ENTITY, rint(this.tur_head.avelocity_x));
+               WriteShort(MSG_ENTITY, rint(this.tur_head.avelocity_y));
        }
 
        if(sf & TNSF_MOVE)
        {
        }
 
        if(sf & TNSF_MOVE)
        {
-               WriteShort(MSG_ENTITY, rint(self.origin_x));
-               WriteShort(MSG_ENTITY, rint(self.origin_y));
-               WriteShort(MSG_ENTITY, rint(self.origin_z));
+               WriteShort(MSG_ENTITY, rint(this.origin_x));
+               WriteShort(MSG_ENTITY, rint(this.origin_y));
+               WriteShort(MSG_ENTITY, rint(this.origin_z));
 
 
-               WriteShort(MSG_ENTITY, rint(self.velocity_x));
-               WriteShort(MSG_ENTITY, rint(self.velocity_y));
-               WriteShort(MSG_ENTITY, rint(self.velocity_z));
+               WriteShort(MSG_ENTITY, rint(this.velocity_x));
+               WriteShort(MSG_ENTITY, rint(this.velocity_y));
+               WriteShort(MSG_ENTITY, rint(this.velocity_z));
 
 
-               WriteShort(MSG_ENTITY, rint(self.angles_y));
+               WriteShort(MSG_ENTITY, rint(this.angles_y));
        }
 
        if(sf & TNSF_ANIM)
        {
        }
 
        if(sf & TNSF_ANIM)
        {
-               WriteCoord(MSG_ENTITY, self.anim_start_time);
-               WriteByte(MSG_ENTITY, self.frame);
+               WriteCoord(MSG_ENTITY, this.anim_start_time);
+               WriteByte(MSG_ENTITY, this.frame);
        }
 
        if(sf & TNSF_STATUS)
        {
        }
 
        if(sf & TNSF_STATUS)
        {
-               WriteByte(MSG_ENTITY, self.team);
+               WriteByte(MSG_ENTITY, this.team);
 
 
-               if(self.health <= 0)
+               if(this.health <= 0)
                        WriteByte(MSG_ENTITY, 0);
                else
                        WriteByte(MSG_ENTITY, 0);
                else
-                       WriteByte(MSG_ENTITY, ceil((self.health / self.max_health) * 255));
+                       WriteByte(MSG_ENTITY, ceil((this.health / this.max_health) * 255));
        }
 
        return true;
        }
 
        return true;
@@ -430,17 +430,17 @@ void load_unit_settings(entity ent, bool is_reload)
 void turret_projectile_explode(entity this)
 {
 
 void turret_projectile_explode(entity this)
 {
 
-       self.takedamage = DAMAGE_NO;
-       self.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
 #ifdef TURRET_DEBUG
        float d;
 #ifdef TURRET_DEBUG
        float d;
-       d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, self, world, self.owner.shot_force, self.totalfrags, world);
-       self.owner.tur_debug_dmg_t_h = self.owner.tur_debug_dmg_t_h + d;
-       self.owner.tur_debug_dmg_t_f = self.owner.tur_debug_dmg_t_f + self.owner.shot_dmg;
+       d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
+       this.owner.tur_debug_dmg_t_h = this.owner.tur_debug_dmg_t_h + d;
+       this.owner.tur_debug_dmg_t_f = this.owner.tur_debug_dmg_t_f + this.owner.shot_dmg;
 #else
 #else
-       RadiusDamage (self, self.realowner, self.owner.shot_dmg, 0, self.owner.shot_radius, self, world, self.owner.shot_force, self.totalfrags, world);
+       RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
 #endif
 #endif
-       remove(self);
+       remove(this);
 }
 
 void turret_projectile_touch(entity this)
 }
 
 void turret_projectile_touch(entity this)
index 5ac3c2ef6446cbdc865f6d3a0d774edc2ab96f8f..151797b6d891c3360ef1d861048c11f85b1da9a1 100644 (file)
@@ -48,7 +48,7 @@ CLASS(Turret, Object)
     METHOD(Turret, tr_attack, void(Turret this, entity it)) {
         Weapon w = this.m_weapon;
         .entity weaponentity = weaponentities[0];
     METHOD(Turret, tr_attack, void(Turret this, entity it)) {
         Weapon w = this.m_weapon;
         .entity weaponentity = weaponentities[0];
-        w.wr_think(w, self, weaponentity, 1);
+        w.wr_think(w, this, weaponentity, 1);
     }
 #endif
     /** (ALL) */
     }
 #endif
     /** (ALL) */
index 9debc63cc5b97dd254e10486db4d19f50d6e50f1..2d01c36d560c282a3e2b131d1a66364ed691591e 100644 (file)
@@ -174,7 +174,7 @@ METHOD(EWheel, tr_death, void(EWheel this, entity it))
     it.velocity = '0 0 0';
 
 #ifdef EWHEEL_FANCYPATH
     it.velocity = '0 0 0';
 
 #ifdef EWHEEL_FANCYPATH
-    if (self.pathcurrent)
+    if (it.pathcurrent)
         pathlib_deletepath(it.pathcurrent.owner);
 #endif
     it.pathcurrent = NULL;
         pathlib_deletepath(it.pathcurrent.owner);
 #endif
     it.pathcurrent = NULL;
index 6adacff3115eeac09123f6af114edcb480744f7c..ada1bf0636db0a07596ce4d644b49ba02a0792ef 100644 (file)
@@ -38,18 +38,18 @@ METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponen
 
 void turret_flac_projectile_think_explode(entity this)
 {
 
 void turret_flac_projectile_think_explode(entity this)
 {
-    if(self.enemy != world)
-    if(vdist(self.origin - self.enemy.origin, <, self.owner.shot_radius * 3))
-        setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius);
+    if(this.enemy != world)
+    if(vdist(this.origin - this.enemy.origin, <, this.owner.shot_radius * 3))
+        setorigin(this,this.enemy.origin + randomvec() * this.owner.shot_radius);
 
 #ifdef TURRET_DEBUG
 
 #ifdef TURRET_DEBUG
-    float d = RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, world, self.owner.shot_force, self.totalfrags, world);
-    self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d;
-    self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
+    float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
+    this.owner.tur_dbg_dmg_t_h = this.owner.tur_dbg_dmg_t_h + d;
+    this.owner.tur_dbg_dmg_t_f = this.owner.tur_dbg_dmg_t_f + this.owner.shot_dmg;
 #else
 #else
-    RadiusDamage (self, self.realowner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, world, self.owner.shot_force, self.totalfrags, world);
+    RadiusDamage (this, this.realowner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
 #endif
 #endif
-    remove(self);
+    remove(this);
 }
 
 #endif
 }
 
 #endif
index 013c089f3cf4a4a606988d19d7202e5748e1eb5d..bdac1f02930f174648b1ccd8d80dc9188d1cadd6 100644 (file)
@@ -50,8 +50,8 @@ spawnfunc(turret_fusionreactor) { if (!turret_initialize(this, TUR_FUSIONREACTOR
 
 METHOD(FusionReactor, tr_attack, void(FusionReactor this, entity it))
 {
 
 METHOD(FusionReactor, tr_attack, void(FusionReactor this, entity it))
 {
-    self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max);
-    vector fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax);
+    it.enemy.ammo = min(it.enemy.ammo + it.shot_dmg,it.enemy.ammo_max);
+    vector fl_org = 0.5 * (it.enemy.absmin + it.enemy.absmax);
     te_smallflash(fl_org);
 }
 METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it))
     te_smallflash(fl_org);
 }
 METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it))
index f053d782e3b7ea481faa4362d00853aada221c99..0b112f22609178d55ebecb76a976187aaa92731e 100644 (file)
@@ -47,60 +47,60 @@ void turret_hellion_missile_think(entity this)
     vector pre_pos;
     float itime;
 
     vector pre_pos;
     float itime;
 
-    self.nextthink = time + 0.05;
+    this.nextthink = time + 0.05;
 
 
-    olddir = normalize(self.velocity);
+    olddir = normalize(this.velocity);
 
 
-    if(self.max_health < time)
-        turret_projectile_explode(self);
+    if(this.max_health < time)
+        turret_projectile_explode(this);
 
     // Enemy dead? just keep on the current heading then.
 
     // Enemy dead? just keep on the current heading then.
-    if ((self.enemy == world) || (IS_DEAD(self.enemy)))
+    if ((this.enemy == world) || (IS_DEAD(this.enemy)))
     {
 
         // Make sure we dont return to tracking a respawned player
     {
 
         // Make sure we dont return to tracking a respawned player
-        self.enemy = world;
+        this.enemy = world;
 
         // Turn model
 
         // Turn model
-        self.angles = vectoangles(self.velocity);
+        this.angles = vectoangles(this.velocity);
 
 
-        if(vdist(self.origin - self.owner.origin, >, (self.owner.shot_radius * 5)))
-            turret_projectile_explode(self);
+        if(vdist(this.origin - this.owner.origin, >, (this.owner.shot_radius * 5)))
+            turret_projectile_explode(this);
 
         // Accelerate
 
         // Accelerate
-        self.velocity = olddir * min(vlen(self.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max));
+        this.velocity = olddir * min(vlen(this.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max));
 
 
-        UpdateCSQCProjectile(self);
+        UpdateCSQCProjectile(this);
 
         return;
     }
 
     // Enemy in range?
 
         return;
     }
 
     // Enemy in range?
-    if(vdist(self.origin - self.enemy.origin, <, self.owner.shot_radius * 0.2))
-        turret_projectile_explode(self);
+    if(vdist(this.origin - this.enemy.origin, <, this.owner.shot_radius * 0.2))
+        turret_projectile_explode(this);
 
     // Predict enemy position
 
     // Predict enemy position
-    itime = vlen(self.enemy.origin - self.origin) / vlen(self.velocity);
-    pre_pos = self.enemy.origin + self.enemy.velocity * itime;
+    itime = vlen(this.enemy.origin - this.origin) / vlen(this.velocity);
+    pre_pos = this.enemy.origin + this.enemy.velocity * itime;
 
 
-    pre_pos = (pre_pos + self.enemy.origin) * 0.5;
+    pre_pos = (pre_pos + this.enemy.origin) * 0.5;
 
     // Find out the direction to that place
 
     // Find out the direction to that place
-    newdir = normalize(pre_pos - self.origin);
+    newdir = normalize(pre_pos - this.origin);
 
     // Turn
     newdir = normalize(olddir + newdir * 0.35);
 
     // Turn model
 
     // Turn
     newdir = normalize(olddir + newdir * 0.35);
 
     // Turn model
-    self.angles = vectoangles(self.velocity);
+    this.angles = vectoangles(this.velocity);
 
     // Accelerate
 
     // Accelerate
-    self.velocity = newdir * min(vlen(self.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max));
+    this.velocity = newdir * min(vlen(this.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max));
 
     if (itime < 0.05)
 
     if (itime < 0.05)
-        setthink(self, turret_projectile_explode);
+        setthink(this, turret_projectile_explode);
 
 
-    UpdateCSQCProjectile(self);
+    UpdateCSQCProjectile(this);
 }
 
 #endif
 }
 
 #endif
index b1658923e97a80269effd93e370e729d6948defc..5a4677dcec19cb97c8cb48e1ef8e582111a73aa8 100644 (file)
@@ -58,54 +58,54 @@ void turret_hk_missile_think(entity this)
     entity e;
     float ad,edist;
 
     entity e;
     float ad,edist;
 
-    self.nextthink = time + self.ticrate;
+    this.nextthink = time + this.ticrate;
 
 
-    //if (self.cnt < time)
+    //if (this.cnt < time)
     // turret_hk_missile_explode();
 
     // turret_hk_missile_explode();
 
-    if (IS_DEAD(self.enemy))
-        self.enemy = world;
+    if (IS_DEAD(this.enemy))
+        this.enemy = world;
 
     // Pick the closest valid target.
 
     // Pick the closest valid target.
-    if (!self.enemy)
+    if (!this.enemy)
     {
     {
-        e = findradius(self.origin, 5000);
+        e = findradius(this.origin, 5000);
         while (e)
         {
             if (hk_is_valid_target(this, e))
             {
         while (e)
         {
             if (hk_is_valid_target(this, e))
             {
-                if (!self.enemy)
-                    self.enemy = e;
+                if (!this.enemy)
+                    this.enemy = e;
                 else
                 else
-                    if (vlen2(self.origin - e.origin) < vlen2(self.origin - self.enemy.origin))
-                        self.enemy = e;
+                    if (vlen2(this.origin - e.origin) < vlen2(this.origin - this.enemy.origin))
+                        this.enemy = e;
             }
             e = e.chain;
         }
     }
 
             }
             e = e.chain;
         }
     }
 
-    self.angles = vectoangles(self.velocity);
-    self.angles_x = self.angles_x * -1;
-    makevectors(self.angles);
-    self.angles_x = self.angles_x * -1;
+    this.angles = vectoangles(this.velocity);
+    this.angles_x = this.angles_x * -1;
+    makevectors(this.angles);
+    this.angles_x = this.angles_x * -1;
 
 
-    if (self.enemy)
+    if (this.enemy)
     {
     {
-        edist = vlen(self.origin - self.enemy.origin);
+        edist = vlen(this.origin - this.enemy.origin);
         // Close enougth to do decent damage?
         // Close enougth to do decent damage?
-        if ( edist <= (self.owner.shot_radius * 0.25) )
+        if ( edist <= (this.owner.shot_radius * 0.25) )
         {
         {
-            turret_projectile_explode(self);
+            turret_projectile_explode(this);
             return;
         }
 
         // Get data on enemy position
             return;
         }
 
         // Get data on enemy position
-        pre_pos = self.enemy.origin +
-                  self.enemy.velocity *
-                  min((vlen(self.enemy.origin - self.origin) / vlen(self.velocity)),0.5);
+        pre_pos = this.enemy.origin +
+                  this.enemy.velocity *
+                  min((vlen(this.enemy.origin - this.origin) / vlen(this.velocity)),0.5);
 
 
-        traceline(self.origin, pre_pos,true,self.enemy);
-        ve = normalize(pre_pos - self.origin);
+        traceline(this.origin, pre_pos,true,this.enemy);
+        ve = normalize(pre_pos - this.origin);
         fe = trace_fraction;
 
     }
         fe = trace_fraction;
 
     }
@@ -116,20 +116,20 @@ void turret_hk_missile_think(entity this)
         fe = 0;
     }
 
         fe = 0;
     }
 
-    if ((fe != 1) || (self.enemy == world) || (edist > 1000))
+    if ((fe != 1) || (this.enemy == world) || (edist > 1000))
     {
     {
-        myspeed = vlen(self.velocity);
+        myspeed = vlen(this.velocity);
 
         lt_for  = myspeed * 3;
         lt_seek = myspeed * 2.95;
 
         // Trace forward
 
         lt_for  = myspeed * 3;
         lt_seek = myspeed * 2.95;
 
         // Trace forward
-        traceline(self.origin, self.origin + v_forward * lt_for,false,self);
+        traceline(this.origin, this.origin + v_forward * lt_for,false,this);
         vf = trace_endpos;
         ff = trace_fraction;
 
         // Find angular offset
         vf = trace_endpos;
         ff = trace_fraction;
 
         // Find angular offset
-        ad = vlen(vectoangles(normalize(self.enemy.origin - self.origin)) - self.angles);
+        ad = vlen(vectoangles(normalize(this.enemy.origin - this.origin)) - this.angles);
 
         // To close to something, Slow down!
         if ( ((ff < 0.7) || (ad > 4)) && (myspeed > (autocvar_g_turrets_unit_hk_shot_speed)) )
 
         // To close to something, Slow down!
         if ( ((ff < 0.7) || (ad > 4)) && (myspeed > (autocvar_g_turrets_unit_hk_shot_speed)) )
@@ -145,29 +145,29 @@ void turret_hk_missile_think(entity this)
         if (ff < 0.5) pt_seek = 1;
 
         // Trace left
         if (ff < 0.5) pt_seek = 1;
 
         // Trace left
-        traceline(self.origin, self.origin + (-1 * (v_right * pt_seek) + (v_forward * ff)) * lt_seek,false,self);
+        traceline(this.origin, this.origin + (-1 * (v_right * pt_seek) + (v_forward * ff)) * lt_seek,false,this);
         vl = trace_endpos;
         fl = trace_fraction;
 
         // Trace right
         vl = trace_endpos;
         fl = trace_fraction;
 
         // Trace right
-        traceline(self.origin,  self.origin + ((v_right * pt_seek) + (v_forward * ff)) * lt_seek ,false,self);
+        traceline(this.origin,  this.origin + ((v_right * pt_seek) + (v_forward * ff)) * lt_seek ,false,this);
         vr = trace_endpos;
         fr = trace_fraction;
 
         // Trace up
         vr = trace_endpos;
         fr = trace_fraction;
 
         // Trace up
-        traceline(self.origin,  self.origin + ((v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,self);
+        traceline(this.origin,  this.origin + ((v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,this);
         vu = trace_endpos;
         fu = trace_fraction;
 
         // Trace down
         vu = trace_endpos;
         fu = trace_fraction;
 
         // Trace down
-        traceline(self.origin,  self.origin + (-1 * (v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,self);
+        traceline(this.origin,  this.origin + (-1 * (v_up * pt_seek) + (v_forward * ff)) * lt_seek ,false,this);
         vd = trace_endpos;
         fd = trace_fraction;
 
         vd = trace_endpos;
         fd = trace_fraction;
 
-        vl = normalize(vl - self.origin);
-        vr = normalize(vr - self.origin);
-        vu = normalize(vu - self.origin);
-        vd = normalize(vd - self.origin);
+        vl = normalize(vl - this.origin);
+        vr = normalize(vr - this.origin);
+        vu = normalize(vu - this.origin);
+        vd = normalize(vd - this.origin);
 
         // Panic tresh passed, find a single direction and turn as hard as we can
         if (pt_seek == 1)
 
         // Panic tresh passed, find a single direction and turn as hard as we can
         if (pt_seek == 1)
@@ -183,7 +183,7 @@ void turret_hk_missile_think(entity this)
             wishdir = normalize( (vl * fl) + (vr * fr) +  (vu * fu) +  (vd * fd) );
         }
 
             wishdir = normalize( (vl * fl) + (vr * fr) +  (vu * fu) +  (vd * fd) );
         }
 
-        if (self.enemy)
+        if (this.enemy)
         {
             if (fe < 0.1) fe = 0.1; // Make sure we always try to move sligtly towards our target
             wishdir = (wishdir * (1 - fe)) + (ve * fe);
         {
             if (fe < 0.1) fe = 0.1; // Make sure we always try to move sligtly towards our target
             wishdir = (wishdir * (1 - fe)) + (ve * fe);
@@ -192,58 +192,58 @@ void turret_hk_missile_think(entity this)
     else
     {
         // Got a clear path to target, speed up fast (if not at full speed) and go straight for it.
     else
     {
         // Got a clear path to target, speed up fast (if not at full speed) and go straight for it.
-        myspeed = vlen(self.velocity);
+        myspeed = vlen(this.velocity);
         if (myspeed < (autocvar_g_turrets_unit_hk_shot_speed_max))
             myspeed = min(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_accel2),(autocvar_g_turrets_unit_hk_shot_speed_max));
 
         wishdir = ve;
     }
 
         if (myspeed < (autocvar_g_turrets_unit_hk_shot_speed_max))
             myspeed = min(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_accel2),(autocvar_g_turrets_unit_hk_shot_speed_max));
 
         wishdir = ve;
     }
 
-    if ((myspeed > (autocvar_g_turrets_unit_hk_shot_speed)) && (self.cnt > time))
+    if ((myspeed > (autocvar_g_turrets_unit_hk_shot_speed)) && (this.cnt > time))
         myspeed = min(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_accel2),(autocvar_g_turrets_unit_hk_shot_speed_max));
 
     // Ranoutagazfish?
         myspeed = min(myspeed * (autocvar_g_turrets_unit_hk_shot_speed_accel2),(autocvar_g_turrets_unit_hk_shot_speed_max));
 
     // Ranoutagazfish?
-    if (self.cnt < time)
+    if (this.cnt < time)
     {
     {
-        self.cnt = time + 0.25;
-        self.nextthink = 0;
-        self.movetype           = MOVETYPE_BOUNCE;
+        this.cnt = time + 0.25;
+        this.nextthink = 0;
+        this.movetype           = MOVETYPE_BOUNCE;
         return;
     }
 
     // Calculate new heading
         return;
     }
 
     // Calculate new heading
-    olddir = normalize(self.velocity);
+    olddir = normalize(this.velocity);
     newdir = normalize(olddir + wishdir * (autocvar_g_turrets_unit_hk_shot_speed_turnrate));
 
     // Set heading & speed
     newdir = normalize(olddir + wishdir * (autocvar_g_turrets_unit_hk_shot_speed_turnrate));
 
     // Set heading & speed
-    self.velocity = newdir * myspeed;
+    this.velocity = newdir * myspeed;
 
     // Align model with new heading
 
     // Align model with new heading
-    self.angles = vectoangles(self.velocity);
+    this.angles = vectoangles(this.velocity);
 
 
 #ifdef TURRET_DEBUG_HK
 
 
 #ifdef TURRET_DEBUG_HK
-    //if(self.atime < time) {
+    //if(this.atime < time) {
     if ((fe <= 0.99)||(edist > 1000))
     {
     if ((fe <= 0.99)||(edist > 1000))
     {
-        te_lightning2(world,self.origin, self.origin + vr * lt_seek);
-        te_lightning2(world,self.origin, self.origin + vl * lt_seek);
-        te_lightning2(world,self.origin, self.origin + vu * lt_seek);
-        te_lightning2(world,self.origin, self.origin + vd * lt_seek);
-        te_lightning2(world,self.origin, vf);
+        te_lightning2(world,this.origin, this.origin + vr * lt_seek);
+        te_lightning2(world,this.origin, this.origin + vl * lt_seek);
+        te_lightning2(world,this.origin, this.origin + vu * lt_seek);
+        te_lightning2(world,this.origin, this.origin + vd * lt_seek);
+        te_lightning2(world,this.origin, vf);
     }
     else
     {
     }
     else
     {
-        te_lightning2(world,self.origin, self.enemy.origin);
+        te_lightning2(world,this.origin, this.enemy.origin);
     }
     bprint("Speed: ", ftos(rint(myspeed)), "\n");
     bprint("Trace to solid: ", ftos(rint(ff * 100)), "%\n");
     bprint("Trace to target:", ftos(rint(fe * 100)), "%\n");
     }
     bprint("Speed: ", ftos(rint(myspeed)), "\n");
     bprint("Trace to solid: ", ftos(rint(ff * 100)), "%\n");
     bprint("Trace to target:", ftos(rint(fe * 100)), "%\n");
-    self.atime = time + 0.2;
+    this.atime = time + 0.2;
     //}
 #endif
 
     //}
 #endif
 
-    UpdateCSQCProjectile(self);
+    UpdateCSQCProjectile(this);
 }
 
 bool hk_is_valid_target(entity this, entity e_target)
 }
 
 bool hk_is_valid_target(entity this, entity e_target)
index 1f6d62c95b78bb7fa13a81b8955b00ef4f6b2a05..ea48a6479024734fd4a425f044c37548d40118e9 100644 (file)
@@ -54,37 +54,37 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity
 
 void beam_think(entity this)
 {
 
 void beam_think(entity this)
 {
-    if ((time > self.cnt) || (IS_DEAD(self.owner)))
+    if ((time > this.cnt) || (IS_DEAD(this.owner)))
     {
     {
-        self.owner.attack_finished_single[0] = time + self.owner.shot_refire;
-        self.owner.fireflag = 2;
-        self.owner.tur_head.frame = 10;
-        sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
-        remove(self);
+        this.owner.attack_finished_single[0] = time + this.owner.shot_refire;
+        this.owner.fireflag = 2;
+        this.owner.tur_head.frame = 10;
+        sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
+        remove(this);
         return;
     }
 
         return;
     }
 
-    turret_do_updates(self.owner);
+    turret_do_updates(this.owner);
 
 
-    if (time - self.shot_spread > 0)
+    if (time - this.shot_spread > 0)
     {
     {
-        self.shot_spread = time + 2;
-        sound (self, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM);
+        this.shot_spread = time + 2;
+        sound (this, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM);
     }
 
 
     }
 
 
-    self.nextthink = time + self.ticrate;
+    this.nextthink = time + this.ticrate;
 
 
-    self.owner.attack_finished_single[0] = time + frametime;
-    FireImoBeam (   self.owner, self.tur_shotorg,
-                    self.tur_shotorg + self.tur_shotdir_updated * self.target_range,
-                    '-1 -1 -1' * self.shot_radius,
-                    '1 1 1' * self.shot_radius,
-                    self.shot_force,
+    this.owner.attack_finished_single[0] = time + frametime;
+    FireImoBeam (   this.owner, this.tur_shotorg,
+                    this.tur_shotorg + this.tur_shotdir_updated * this.target_range,
+                    '-1 -1 -1' * this.shot_radius,
+                    '1 1 1' * this.shot_radius,
+                    this.shot_force,
                     this.shot_dmg,
                     0.75,
                     DEATH_TURRET_PHASER.m_id);
                     this.shot_dmg,
                     0.75,
                     DEATH_TURRET_PHASER.m_id);
-    self.scale = vlen(self.owner.tur_shotorg - trace_endpos) / 256;
+    this.scale = vlen(this.owner.tur_shotorg - trace_endpos) / 256;
 
 }
 
 
 }
 
index 805e13012b2328f095fbf4e0cb47c22ef9c95667..41e7cd491ce7d8fb1456b0511b65d08418e4123a 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-* Update self.tur_shotorg by getting up2date bone info
+* Update this.tur_shotorg by getting up2date bone info
 * NOTICE this func overwrites the global v_forward, v_right and v_up vectors.
 */
 float turret_tag_fire_update(entity this)
 * NOTICE this func overwrites the global v_forward, v_right and v_up vectors.
 */
 float turret_tag_fire_update(entity this)
index 3d94aa51fb694fca9327f3d4cc8aef911aa86cb6..ec437b9cb6559b6779e197c84f9f0f01ca295055 100644 (file)
@@ -8,7 +8,7 @@ bool vehicle_send(entity to, int sf)
 
        if(sf & VSF_SPAWN)
        {
 
        if(sf & VSF_SPAWN)
        {
-               WriteByte(MSG_ENTITY, self.vehicleid);
+               WriteByte(MSG_ENTITY, this.vehicleid);
        }
 
        if(sf & VSF_SETUP)
        }
 
        if(sf & VSF_SETUP)
@@ -215,21 +215,21 @@ void vehicles_projectile_damage(entity this, entity inflictor, entity attacker,
 
 void vehicles_projectile_explode(entity this)
 {
 
 void vehicles_projectile_explode(entity this)
 {
-       if(self.owner && other != world)
+       if(this.owner && other != world)
        {
        {
-               if(other == self.owner.vehicle)
+               if(other == this.owner.vehicle)
                        return;
 
                        return;
 
-               if(other == self.owner.vehicle.tur_head)
+               if(other == this.owner.vehicle.tur_head)
                        return;
        }
 
        PROJECTILE_TOUCH(this);
 
                        return;
        }
 
        PROJECTILE_TOUCH(this);
 
-       self.event_damage = func_null;
-       RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, world, self.shot_force, self.totalfrags, other);
+       this.event_damage = func_null;
+       RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, world, this.shot_force, this.totalfrags, other);
 
 
-       remove (self);
+       remove (this);
 }
 
 void vehicles_projectile_explode_use(entity this, entity actor, entity trigger)
 }
 
 void vehicles_projectile_explode_use(entity this, entity actor, entity trigger)
@@ -292,19 +292,19 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
 
 void vehicles_gib_explode(entity this)
 {
 
 void vehicles_gib_explode(entity this)
 {
-       sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-       Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
-       Send_Effect(EFFECT_EXPLOSION_SMALL, self.wp00.origin + '0 0 64', '0 0 0', 1);
-       remove(self);
+       sound (this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+       Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (this.origin + '0 0 100'), '0 0 0', 1);
+       Send_Effect(EFFECT_EXPLOSION_SMALL, this.wp00.origin + '0 0 64', '0 0 0', 1);
+       remove(this);
 }
 
 void vehicles_gib_think(entity this)
 {
 }
 
 void vehicles_gib_think(entity this)
 {
-       self.alpha -= 0.1;
-       if(self.cnt >= time)
-               remove(self);
+       this.alpha -= 0.1;
+       if(this.cnt >= time)
+               remove(this);
        else
        else
-               self.nextthink = time + 0.1;
+               this.nextthink = time + 0.1;
 }
 
 entity vehicle_tossgib(entity this, entity _template, vector _vel, string _tag, bool _burn, bool _explode, float _maxtime, vector _rot)
 }
 
 entity vehicle_tossgib(entity this, entity _template, vector _vel, string _tag, bool _burn, bool _explode, float _maxtime, vector _rot)
@@ -456,23 +456,23 @@ void vehicles_clearreturn(entity veh)
 void vehicles_spawn(entity this);
 void vehicles_return(entity this)
 {
 void vehicles_spawn(entity this);
 void vehicles_return(entity this)
 {
-       Send_Effect(EFFECT_TELEPORT, self.wp00.origin + '0 0 64', '0 0 0', 1);
+       Send_Effect(EFFECT_TELEPORT, this.wp00.origin + '0 0 64', '0 0 0', 1);
 
 
-       setthink(self.wp00, vehicles_spawn);
-       self.wp00.nextthink = time;
+       setthink(this.wp00, vehicles_spawn);
+       this.wp00.nextthink = time;
 
 
-       if(self.waypointsprite_attached)
-               WaypointSprite_Kill(self.waypointsprite_attached);
+       if(this.waypointsprite_attached)
+               WaypointSprite_Kill(this.waypointsprite_attached);
 
 
-       remove(self);
+       remove(this);
 }
 
 void vehicles_showwp_goaway(entity this)
 {
 }
 
 void vehicles_showwp_goaway(entity this)
 {
-       if(self.waypointsprite_attached)
-               WaypointSprite_Kill(self.waypointsprite_attached);
+       if(this.waypointsprite_attached)
+               WaypointSprite_Kill(this.waypointsprite_attached);
 
 
-       remove(self);
+       remove(this);
 
 }
 
 
 }
 
@@ -587,16 +587,16 @@ void vehicles_regen(entity this, float timer, .float regen_field, float field_ma
 
 void shieldhit_think(entity this)
 {
 
 void shieldhit_think(entity this)
 {
-       self.alpha -= 0.1;
-       if (self.alpha <= 0)
+       this.alpha -= 0.1;
+       if (this.alpha <= 0)
        {
        {
-               // setmodel(self, MDL_Null);
-               self.alpha = -1;
-               self.effects |= EF_NODRAW;
+               // setmodel(this, MDL_Null);
+               this.alpha = -1;
+               this.effects |= EF_NODRAW;
        }
        else
        {
        }
        else
        {
-               self.nextthink = time + 0.1;
+               this.nextthink = time + 0.1;
        }
 }
 
        }
 }
 
@@ -893,26 +893,26 @@ void vehicles_exit(entity vehic, bool eject)
 
 void vehicles_touch(entity this)
 {
 
 void vehicles_touch(entity this)
 {
-       if(MUTATOR_CALLHOOK(VehicleTouch, self, other))
+       if(MUTATOR_CALLHOOK(VehicleTouch, this, other))
                return;
 
        // Vehicle currently in use
                return;
 
        // Vehicle currently in use
-       if(self.owner)
+       if(this.owner)
        {
        {
-               if(!forbidWeaponUse(self.owner))
+               if(!forbidWeaponUse(this.owner))
                if(other != world)
                if(other != world)
-               if((self.origin_z + self.maxs_z) > (other.origin_z))
+               if((this.origin_z + this.maxs_z) > (other.origin_z))
                if(vehicles_crushable(other))
                {
                if(vehicles_crushable(other))
                {
-                       if(vdist(self.velocity, >=, 30))
-                               Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH.m_id, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
+                       if(vdist(this.velocity, >=, 30))
+                               Damage(other, this, this.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH.m_id, '0 0 0', normalize(other.origin - this.origin) * autocvar_g_vehicles_crush_force);
 
                        return; // Dont do selfdamage when hitting "soft targets".
                }
 
 
                        return; // Dont do selfdamage when hitting "soft targets".
                }
 
-               if(self.play_time < time) {
-                       Vehicle info = Vehicles_from(self.vehicleid);
-                       info.vr_impact(info, self);
+               if(this.play_time < time) {
+                       Vehicle info = Vehicles_from(this.vehicleid);
+                       info.vr_impact(info, this);
                }
 
                return;
                }
 
                return;
@@ -921,7 +921,7 @@ void vehicles_touch(entity this)
        if(autocvar_g_vehicles_enter)
                return;
 
        if(autocvar_g_vehicles_enter)
                return;
 
-       vehicles_enter(other, self);
+       vehicles_enter(other, this);
 }
 
 bool vehicle_impulse(entity this, int imp)
 }
 
 bool vehicle_impulse(entity this, int imp)
@@ -935,7 +935,7 @@ bool vehicle_impulse(entity this, int imp)
        {
                case IMP_weapon_drop.impulse:
                {
        {
                case IMP_weapon_drop.impulse:
                {
-                       stuffcmd(self, "\ntoggle cl_eventchase_vehicle\nset _vehicles_shownchasemessage 1\n");
+                       stuffcmd(this, "\ntoggle cl_eventchase_vehicle\nset _vehicles_shownchasemessage 1\n");
                        return true;
                }
        }
                        return true;
                }
        }
@@ -1081,66 +1081,66 @@ void vehicles_enter(entity pl, entity veh)
 
 void vehicles_think(entity this)
 {
 
 void vehicles_think(entity this)
 {
-       self.nextthink = time;
+       this.nextthink = time;
 
 
-       if(self.owner)
-               self.owner.vehicle_weapon2mode = self.vehicle_weapon2mode;
+       if(this.owner)
+               this.owner.vehicle_weapon2mode = this.vehicle_weapon2mode;
 
 
-       Vehicle info = Vehicles_from(self.vehicleid);
-       info.vr_think(info, self);
+       Vehicle info = Vehicles_from(this.vehicleid);
+       info.vr_think(info, this);
 
 
-       vehicles_painframe(self);
+       vehicles_painframe(this);
 
 
-       CSQCMODEL_AUTOUPDATE(self);
+       CSQCMODEL_AUTOUPDATE(this);
 }
 
 // initialization
 void vehicles_spawn(entity this)
 {
 }
 
 // initialization
 void vehicles_spawn(entity this)
 {
-       LOG_TRACE("Spawning vehicle: ", self.classname, "\n");
+       LOG_TRACE("Spawning vehicle: ", this.classname, "\n");
 
        // disown & reset
 
        // disown & reset
-       self.vehicle_hudmodel.viewmodelforclient = self;
-
-       self.owner                              = world;
-       settouch(self, vehicles_touch);
-       self.event_damage               = vehicles_damage;
-       self.iscreature                 = true;
-       self.teleportable               = false; // no teleporting for vehicles, too buggy
-       self.damagedbycontents  = true;
-       self.movetype                   = MOVETYPE_WALK;
-       self.solid                              = SOLID_SLIDEBOX;
-       self.takedamage                 = DAMAGE_AIM;
-       self.deadflag                   = DEAD_NO;
-       self.bot_attack                 = true;
-       self.flags                              = FL_NOTARGET;
-       self.avelocity                  = '0 0 0';
-       self.velocity                   = '0 0 0';
-       setthink(self, vehicles_think);
-       self.nextthink                  = time;
+       this.vehicle_hudmodel.viewmodelforclient = this;
+
+       this.owner                              = world;
+       settouch(this, vehicles_touch);
+       this.event_damage               = vehicles_damage;
+       this.iscreature                 = true;
+       this.teleportable               = false; // no teleporting for vehicles, too buggy
+       this.damagedbycontents  = true;
+       this.movetype                   = MOVETYPE_WALK;
+       this.solid                              = SOLID_SLIDEBOX;
+       this.takedamage                 = DAMAGE_AIM;
+       this.deadflag                   = DEAD_NO;
+       this.bot_attack                 = true;
+       this.flags                              = FL_NOTARGET;
+       this.avelocity                  = '0 0 0';
+       this.velocity                   = '0 0 0';
+       setthink(this, vehicles_think);
+       this.nextthink                  = time;
 
        // Reset locking
 
        // Reset locking
-       self.lock_strength = 0;
-       self.lock_target = world;
-       self.misc_bulletcounter = 0;
+       this.lock_strength = 0;
+       this.lock_target = world;
+       this.misc_bulletcounter = 0;
 
        // Return to spawn
 
        // Return to spawn
-       self.angles = self.pos2;
-       setorigin(self, self.pos1);
+       this.angles = this.pos2;
+       setorigin(this, this.pos1);
        // Show it
        // Show it
-       Send_Effect(EFFECT_TELEPORT, self.origin + '0 0 64', '0 0 0', 1);
+       Send_Effect(EFFECT_TELEPORT, this.origin + '0 0 64', '0 0 0', 1);
 
 
-       if(self.vehicle_controller)
-               self.team = self.vehicle_controller.team;
+       if(this.vehicle_controller)
+               this.team = this.vehicle_controller.team;
 
 
-       FOREACH_CLIENT(IS_PLAYER(it) && it.hook.aiment == self, RemoveGrapplingHook(it));
+       FOREACH_CLIENT(IS_PLAYER(it) && it.hook.aiment == this, RemoveGrapplingHook(it));
 
 
-       vehicles_reset_colors(self);
+       vehicles_reset_colors(this);
 
 
-       Vehicle info = Vehicles_from(self.vehicleid);
-       info.vr_spawn(info, self);
+       Vehicle info = Vehicles_from(this.vehicleid);
+       info.vr_spawn(info, this);
 
 
-       CSQCMODEL_AUTOINIT(self);
+       CSQCMODEL_AUTOINIT(this);
 }
 
 bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
 }
 
 bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
index 54550c50902fe87b265b56a04bfa30a616b1f2ef..8c53724b578525c50b0fd70337a53c42b8de624e 100644 (file)
@@ -44,14 +44,14 @@ float autocvar_g_vehicles_weapon_damagerate = 1;
 .entity gunner1;
 .entity gunner2;
 
 .entity gunner1;
 .entity gunner2;
 
-.float vehicle_health = _STAT(VEHICLESTAT_HEALTH);  /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
-.float vehicle_energy = _STAT(VEHICLESTAT_ENERGY);  /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
-.float vehicle_shield = _STAT(VEHICLESTAT_SHIELD);  /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
-
-.float vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1);   /// If self is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If self is vehile, this is the real ammo1 value.
-.float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1); /// If self is player this is 0..100 indicating percentage of primary reload status. If self is vehile, this is the real reload1 value.
-.float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2);   /// If self is player this is 0..100 indicating percentage of secondary ammo left. If self is vehile, this is the real ammo2 value.
-.float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2); /// If self is player this is 0..100 indicating percentage of secondary reload status. If self is vehile, this is the real reload2 value.
+.float vehicle_health = _STAT(VEHICLESTAT_HEALTH);  /// If ent is player this is 0..100 indicating precentage of health left on vehicle. If ent is vehile, this is the real health value.
+.float vehicle_energy = _STAT(VEHICLESTAT_ENERGY);  /// If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehile, this is the real energy value.
+.float vehicle_shield = _STAT(VEHICLESTAT_SHIELD);  /// If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehile, this is the real shield value.
+
+.float vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1);   /// If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If ent is vehile, this is the real ammo1 value.
+.float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1); /// If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehile, this is the real reload1 value.
+.float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2);   /// If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehile, this is the real ammo2 value.
+.float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2); /// If ent is player this is 0..100 indicating percentage of secondary reload status. If ent is vehile, this is the real reload2 value.
 
 .float sound_nexttime;
 const float VOL_VEHICLEENGINE = 1;
 
 .float sound_nexttime;
 const float VOL_VEHICLEENGINE = 1;
index daa2865d406e18b3bbbf3f17c6ad71aae1ec1ad0..ac98dadbe841f254e9ad26f85cdcd62ae93ef85f 100644 (file)
@@ -630,16 +630,16 @@ void bumblebee_land(entity this)
        float hgt;
 
        hgt = raptor_altitude(this, 512);
        float hgt;
 
        hgt = raptor_altitude(this, 512);
-       self.velocity = (self.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime);
-       self.angles_x *= 0.95;
-       self.angles_z *= 0.95;
+       this.velocity = (this.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime);
+       this.angles_x *= 0.95;
+       this.angles_z *= 0.95;
 
        if(hgt < 16)
 
        if(hgt < 16)
-               setthink(self, vehicles_think);
+               setthink(this, vehicles_think);
 
 
-       self.nextthink = time;
+       this.nextthink = time;
 
 
-       CSQCMODEL_AUTOUPDATE(self);
+       CSQCMODEL_AUTOUPDATE(this);
 }
 
 void bumblebee_exit(entity this, int eject)
 }
 
 void bumblebee_exit(entity this, int eject)
@@ -686,33 +686,33 @@ void bumblebee_exit(entity this, int eject)
 
 void bumblebee_blowup(entity this)
 {
 
 void bumblebee_blowup(entity this)
 {
-       RadiusDamage(self, self.enemy, autocvar_g_vehicle_bumblebee_blowup_coredamage,
+       RadiusDamage(this, this.enemy, autocvar_g_vehicle_bumblebee_blowup_coredamage,
                                 autocvar_g_vehicle_bumblebee_blowup_edgedamage,
                                 autocvar_g_vehicle_bumblebee_blowup_edgedamage,
-                                autocvar_g_vehicle_bumblebee_blowup_radius, self, world,
+                                autocvar_g_vehicle_bumblebee_blowup_radius, this, world,
                                 autocvar_g_vehicle_bumblebee_blowup_forceintensity,
                                 DEATH_VH_BUMB_DEATH.m_id, world);
 
                                 autocvar_g_vehicle_bumblebee_blowup_forceintensity,
                                 DEATH_VH_BUMB_DEATH.m_id, world);
 
-       sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-       Send_Effect(EFFECT_EXPLOSION_BIG, (self.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
+       sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+       Send_Effect(EFFECT_EXPLOSION_BIG, (this.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
 
 
-       if(self.owner.deadflag == DEAD_DYING)
-               self.owner.deadflag = DEAD_DEAD;
+       if(this.owner.deadflag == DEAD_DYING)
+               this.owner.deadflag = DEAD_DEAD;
 
 
-       remove(self);
+       remove(this);
 }
 
 void bumblebee_diethink(entity this)
 {
 }
 
 void bumblebee_diethink(entity this)
 {
-       if(time >= self.wait)
-               setthink(self, bumblebee_blowup);
+       if(time >= this.wait)
+               setthink(this, bumblebee_blowup);
 
        if(random() < 0.1)
        {
 
        if(random() < 0.1)
        {
-               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-               Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+               Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (this.origin + '0 0 100'), '0 0 0', 1);
        }
 
        }
 
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 }
 
 spawnfunc(vehicle_bumblebee)
 }
 
 spawnfunc(vehicle_bumblebee)
index 26a6ddd13c9eb8a7f429dd95be989c1bde461796..b2e838f944b92ccec09440b3e37a6b3781e4c762 100644 (file)
@@ -22,23 +22,23 @@ bool bumble_raygun_send(entity this, entity to, float sf)
     WriteByte(MSG_ENTITY, sf);
     if(sf & BRG_SETUP)
     {
     WriteByte(MSG_ENTITY, sf);
     if(sf & BRG_SETUP)
     {
-        WriteByte(MSG_ENTITY, etof(self.realowner));
-        WriteByte(MSG_ENTITY, self.realowner.team);
-        WriteByte(MSG_ENTITY, self.cnt);
+        WriteByte(MSG_ENTITY, etof(this.realowner));
+        WriteByte(MSG_ENTITY, this.realowner.team);
+        WriteByte(MSG_ENTITY, this.cnt);
     }
 
     if(sf & BRG_START)
     {
     }
 
     if(sf & BRG_START)
     {
-        WriteCoord(MSG_ENTITY, self.hook_start_x);
-        WriteCoord(MSG_ENTITY, self.hook_start_y);
-        WriteCoord(MSG_ENTITY, self.hook_start_z);
+        WriteCoord(MSG_ENTITY, this.hook_start_x);
+        WriteCoord(MSG_ENTITY, this.hook_start_y);
+        WriteCoord(MSG_ENTITY, this.hook_start_z);
     }
 
     if(sf & BRG_END)
     {
     }
 
     if(sf & BRG_END)
     {
-        WriteCoord(MSG_ENTITY, self.hook_end_x);
-        WriteCoord(MSG_ENTITY, self.hook_end_y);
-        WriteCoord(MSG_ENTITY, self.hook_end_z);
+        WriteCoord(MSG_ENTITY, this.hook_end_x);
+        WriteCoord(MSG_ENTITY, this.hook_end_y);
+        WriteCoord(MSG_ENTITY, this.hook_end_z);
     }
 
     return true;
     }
 
     return true;
index 24a0682d9eeb0ca37c0e4d9785fcb1e02f1201d7..e212d312467498fe275df03e27a57a808a4389c8 100644 (file)
@@ -414,7 +414,7 @@ void racer_think(entity this)
 
        float forced = autocvar_g_vehicle_racer_upforcedamper;
 
 
        float forced = autocvar_g_vehicle_racer_upforcedamper;
 
-       //int cont = pointcontents(self.origin - '0 0 64');
+       //int cont = pointcontents(this.origin - '0 0 64');
        traceline(this.origin - '0 0 64', this.origin - '0 0 64', MOVE_NOMONSTERS, this);
        //if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
        if(trace_dpstartcontents & DPCONTENTS_LIQUIDSMASK)
        traceline(this.origin - '0 0 64', this.origin - '0 0 64', MOVE_NOMONSTERS, this);
        //if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
        if(trace_dpstartcontents & DPCONTENTS_LIQUIDSMASK)
index f15b8cfb8a74ddfe092069e651355dbd0bc5dc27..1af09990bc5aca8ec8582ce313785a6a24e7cb99 100644 (file)
@@ -69,50 +69,50 @@ void racer_rocket_tracker(entity this)
     vector olddir, newdir;
     float oldvel, newvel;
 
     vector olddir, newdir;
     float oldvel, newvel;
 
-    self.nextthink  = time;
+    this.nextthink  = time;
 
 
-    if (IS_DEAD(self.owner) || self.cnt < time)
+    if (IS_DEAD(this.owner) || this.cnt < time)
     {
     {
-        self.use(self, NULL, NULL);
+        this.use(this, NULL, NULL);
         return;
     }
 
         return;
     }
 
-    if(!self.realowner.vehicle)
+    if(!this.realowner.vehicle)
     {
     {
-        UpdateCSQCProjectile(self);
+        UpdateCSQCProjectile(this);
         return;
     }
 
         return;
     }
 
-    olddir = normalize(self.velocity);
-    oldvel = vlen(self.velocity);
-    newvel = oldvel + self.lip;
+    olddir = normalize(this.velocity);
+    oldvel = vlen(this.velocity);
+    newvel = oldvel + this.lip;
     makevectors(vectoangles(olddir));
 
     makevectors(vectoangles(olddir));
 
-    float time_to_impact = min(vlen(self.enemy.origin - self.origin) / vlen(self.velocity), 1);
-    vector predicted_origin = self.enemy.origin + self.enemy.velocity * time_to_impact;
+    float time_to_impact = min(vlen(this.enemy.origin - this.origin) / vlen(this.velocity), 1);
+    vector predicted_origin = this.enemy.origin + this.enemy.velocity * time_to_impact;
 
 
-    traceline(self.origin, self.origin + v_forward * 64 - '0 0 32', MOVE_NORMAL, self);
-    newdir = normalize(predicted_origin - self.origin);
+    traceline(this.origin, this.origin + v_forward * 64 - '0 0 32', MOVE_NORMAL, this);
+    newdir = normalize(predicted_origin - this.origin);
 
     //vector
 
     //vector
-    float height_diff = predicted_origin_z - self.origin_z;
+    float height_diff = predicted_origin_z - this.origin_z;
 
     if(vdist(newdir - v_forward, >, autocvar_g_vehicle_racer_rocket_locked_maxangle))
     {
         //bprint("Target lost!\n");
         //dprint("OF:", ftos(vlen(newdir - v_forward)), "\n");
 
     if(vdist(newdir - v_forward, >, autocvar_g_vehicle_racer_rocket_locked_maxangle))
     {
         //bprint("Target lost!\n");
         //dprint("OF:", ftos(vlen(newdir - v_forward)), "\n");
-        setthink(self, racer_rocket_groundhugger);
+        setthink(this, racer_rocket_groundhugger);
         return;
     }
 
         return;
     }
 
-    if(trace_fraction != 1.0 && trace_ent != self.enemy)
+    if(trace_fraction != 1.0 && trace_ent != this.enemy)
         newdir_z += 16 * sys_frametime;
 
         newdir_z += 16 * sys_frametime;
 
-    self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
-    self.velocity_z -= 800 * sys_frametime;
-    self.velocity_z += max(height_diff, autocvar_g_vehicle_racer_rocket_climbspeed) * sys_frametime ;
+    this.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
+    this.velocity_z -= 800 * sys_frametime;
+    this.velocity_z += max(height_diff, autocvar_g_vehicle_racer_rocket_climbspeed) * sys_frametime ;
 
 
-    UpdateCSQCProjectile(self);
+    UpdateCSQCProjectile(this);
     return;
 }
 
     return;
 }
 
@@ -121,50 +121,50 @@ void racer_rocket_groundhugger(entity this)
     vector olddir, newdir;
     float oldvel, newvel;
 
     vector olddir, newdir;
     float oldvel, newvel;
 
-    self.nextthink  = time;
+    this.nextthink  = time;
 
 
-    if(IS_DEAD(self.owner) || self.cnt < time)
+    if(IS_DEAD(this.owner) || this.cnt < time)
     {
     {
-        self.use(self, NULL, NULL);
+        this.use(this, NULL, NULL);
         return;
     }
 
         return;
     }
 
-    if(!self.realowner.vehicle)
+    if(!this.realowner.vehicle)
     {
     {
-        UpdateCSQCProjectile(self);
+        UpdateCSQCProjectile(this);
         return;
     }
 
         return;
     }
 
-    olddir = normalize(self.velocity);
-    oldvel = vlen(self.velocity);
-    newvel = oldvel + self.lip;
+    olddir = normalize(this.velocity);
+    oldvel = vlen(this.velocity);
+    newvel = oldvel + this.lip;
 
 
-    tracebox(self.origin, self.mins, self.maxs, self.origin + olddir * 64, MOVE_WORLDONLY,self);
+    tracebox(this.origin, this.mins, this.maxs, this.origin + olddir * 64, MOVE_WORLDONLY,this);
     if(trace_fraction <= 0.5)
     {
         // Hitting somethign soon, just speed ahead
     if(trace_fraction <= 0.5)
     {
         // Hitting somethign soon, just speed ahead
-        self.velocity = olddir * newvel;
-        UpdateCSQCProjectile(self);
+        this.velocity = olddir * newvel;
+        UpdateCSQCProjectile(this);
         return;
     }
 
         return;
     }
 
-    traceline(trace_endpos, trace_endpos - '0 0 64', MOVE_NORMAL, self);
+    traceline(trace_endpos, trace_endpos - '0 0 64', MOVE_NORMAL, this);
     if(trace_fraction != 1.0)
     {
     if(trace_fraction != 1.0)
     {
-        newdir = normalize(trace_endpos + '0 0 64' - self.origin) * autocvar_g_vehicle_racer_rocket_turnrate;
-        self.velocity = normalize(olddir + newdir) * newvel;
+        newdir = normalize(trace_endpos + '0 0 64' - this.origin) * autocvar_g_vehicle_racer_rocket_turnrate;
+        this.velocity = normalize(olddir + newdir) * newvel;
     }
     else
     {
     }
     else
     {
-        self.velocity = olddir * newvel;
-        self.velocity_z -= 1600 * sys_frametime; // 2x grav looks better for this one
+        this.velocity = olddir * newvel;
+        this.velocity_z -= 1600 * sys_frametime; // 2x grav looks better for this one
     }
 
     }
 
-    int cont = pointcontents(self.origin - '0 0 32');
+    int cont = pointcontents(this.origin - '0 0 32');
     if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
     if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
-        self.velocity_z += 200;
+        this.velocity_z += 200;
 
 
-    UpdateCSQCProjectile(self);
+    UpdateCSQCProjectile(this);
     return;
 }
 
     return;
 }
 
index 6273e83b5454b097f5dae36c4402b20339c9d3e2..1e364e5491e52040cf787b6a9035290a27d3f436 100644 (file)
@@ -536,26 +536,26 @@ void raptor_blowup(entity this)
 
 void raptor_diethink(entity this)
 {
 
 void raptor_diethink(entity this)
 {
-       if(time >= self.wait)
-               setthink(self, raptor_blowup);
+       if(time >= this.wait)
+               setthink(this, raptor_blowup);
 
        if(random() < 0.05)
        {
 
        if(random() < 0.05)
        {
-               sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-               Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+               sound (this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+               Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (this.origin + '0 0 100'), '0 0 0', 1);
        }
        }
-       self.nextthink = time;
+       this.nextthink = time;
 
 
-       CSQCMODEL_AUTOUPDATE(self);
+       CSQCMODEL_AUTOUPDATE(this);
 }
 
 // If we dont do this ever now and then, the raptors rotors
 // stop working, presumably due to angle overflow. cute.
 void raptor_rotor_anglefix(entity this)
 {
 }
 
 // If we dont do this ever now and then, the raptors rotors
 // stop working, presumably due to angle overflow. cute.
 void raptor_rotor_anglefix(entity this)
 {
-       self.gun1.angles_y = anglemods(self.gun1.angles_y);
-       self.gun2.angles_y = anglemods(self.gun2.angles_y);
-       self.nextthink = time + 15;
+       this.gun1.angles_y = anglemods(this.gun1.angles_y);
+       this.gun2.angles_y = anglemods(this.gun2.angles_y);
+       this.nextthink = time + 15;
 }
 
 bool raptor_impulse(entity this, int _imp)
 }
 
 bool raptor_impulse(entity this, int _imp)
index 1aca463811c90bd3fa4d72d91a3083d1585dfada..3541b2568999fc5753a3a4e13ec3503dc0167d08 100644 (file)
@@ -87,33 +87,33 @@ METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weapone
 
 void raptor_bomblet_boom(entity this)
 {
 
 void raptor_bomblet_boom(entity this)
 {
-    RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
+    RadiusDamage (this, this.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
                                     autocvar_g_vehicle_raptor_bomblet_edgedamage,
                                     autocvar_g_vehicle_raptor_bomblet_radius, world, world,
                                     autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, world);
                                     autocvar_g_vehicle_raptor_bomblet_edgedamage,
                                     autocvar_g_vehicle_raptor_bomblet_radius, world, world,
                                     autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, world);
-    remove(self);
+    remove(this);
 }
 
 void raptor_bomblet_touch(entity this)
 {
 }
 
 void raptor_bomblet_touch(entity this)
 {
-    if(other == self.owner)
+    if(other == this.owner)
         return;
 
     PROJECTILE_TOUCH(this);
         return;
 
     PROJECTILE_TOUCH(this);
-    setthink(self, raptor_bomblet_boom);
-    self.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay;
+    setthink(this, raptor_bomblet_boom);
+    this.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay;
 }
 
 void raptor_bomb_burst(entity this)
 {
 }
 
 void raptor_bomb_burst(entity this)
 {
-    if(self.cnt > time)
+    if(this.cnt > time)
     if(autocvar_g_vehicle_raptor_bomblet_alt)
     {
     if(autocvar_g_vehicle_raptor_bomblet_alt)
     {
-        self.nextthink = time;
-        traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
-        if((trace_fraction == 1.0) || (vdist(self.origin - self.owner.origin, <, autocvar_g_vehicle_raptor_bomblet_radius)))
+        this.nextthink = time;
+        traceline(this.origin, this.origin + (normalize(this.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, this);
+        if((trace_fraction == 1.0) || (vdist(this.origin - this.owner.origin, <, autocvar_g_vehicle_raptor_bomblet_radius)))
         {
         {
-            UpdateCSQCProjectile(self);
+            UpdateCSQCProjectile(this);
             return;
         }
     }
             return;
         }
     }
@@ -121,26 +121,26 @@ void raptor_bomb_burst(entity this)
     entity bomblet;
     float i;
 
     entity bomblet;
     float i;
 
-    Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_VH_RAPT_FRAGMENT.m_id, 0, self);
+    Damage_DamageInfo(this.origin, 0, 0, 0, '0 0 0', DEATH_VH_RAPT_FRAGMENT.m_id, 0, this);
 
     for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
     {
         bomblet = spawn();
 
     for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
     {
         bomblet = spawn();
-        setorigin(bomblet, self.origin);
+        setorigin(bomblet, this.origin);
 
         bomblet.movetype       = MOVETYPE_TOSS;
         settouch(bomblet, raptor_bomblet_touch);
         setthink(bomblet, raptor_bomblet_boom);
         bomblet.nextthink   = time + 5;
 
         bomblet.movetype       = MOVETYPE_TOSS;
         settouch(bomblet, raptor_bomblet_touch);
         setthink(bomblet, raptor_bomblet_boom);
         bomblet.nextthink   = time + 5;
-        bomblet.owner     = self.owner;
-        bomblet.realowner   = self.realowner;
-        bomblet.velocity       = normalize(normalize(self.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(self.velocity);
+        bomblet.owner     = this.owner;
+        bomblet.realowner   = this.realowner;
+        bomblet.velocity       = normalize(normalize(this.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(this.velocity);
 
         PROJECTILE_MAKETRIGGER(bomblet);
         CSQCProjectile(bomblet, true, PROJECTILE_RAPTORBOMBLET, true);
     }
 
 
         PROJECTILE_MAKETRIGGER(bomblet);
         CSQCProjectile(bomblet, true, PROJECTILE_RAPTORBOMBLET, true);
     }
 
-    remove(self);
+    remove(this);
 }
 
 void raptor_bombdrop(entity this)
 }
 
 void raptor_bombdrop(entity this)
@@ -194,19 +194,19 @@ void raptor_flare_damage(entity this, entity inflictor, entity attacker, float d
 
 void raptor_flare_think(entity this)
 {
 
 void raptor_flare_think(entity this)
 {
-    self.nextthink = time + 0.1;
-    entity _missile = findchainentity(enemy, self.owner);
+    this.nextthink = time + 0.1;
+    entity _missile = findchainentity(enemy, this.owner);
     while(_missile)
     {
         if(_missile.flags & FL_PROJECTILE)
     while(_missile)
     {
         if(_missile.flags & FL_PROJECTILE)
-        if(vdist(self.origin - _missile.origin, <, autocvar_g_vehicle_raptor_flare_range))
+        if(vdist(this.origin - _missile.origin, <, autocvar_g_vehicle_raptor_flare_range))
         if(random() > autocvar_g_vehicle_raptor_flare_chase)
         if(random() > autocvar_g_vehicle_raptor_flare_chase)
-            _missile.enemy = self;
+            _missile.enemy = this;
         _missile = _missile.chain;
     }
 
         _missile = _missile.chain;
     }
 
-    if(self.tur_impacttime < time)
-        remove(self);
+    if(this.tur_impacttime < time)
+        remove(this);
 }
 
 #endif
 }
 
 #endif
index 8c7c4f7fdfab7313af513a936ce3fc6f169f2feb..63924987e22917ede4c2de0e72a48d292df9b839 100644 (file)
@@ -288,7 +288,7 @@ bool spiderbot_frame(entity this)
                                autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
 
                        sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
                                autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
 
                        sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
-                       //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
+                       //trailparticles(this, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
                        Send_Effect(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH, v, v_forward * 2500, 1);
 
                        vehic.vehicle_ammo1 -= autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
                        Send_Effect(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH, v, v_forward * 2500, 1);
 
                        vehic.vehicle_ammo1 -= autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
index 1c808b13ecee4f11c2acf65cf9a80f0a8905162b..6476ebbf00e4a956309d4061df27ced79c177688 100644 (file)
@@ -14,36 +14,36 @@ void spiderbot_rocket_unguided(entity this)
 {
     vector newdir, olddir;
 
 {
     vector newdir, olddir;
 
-    self.nextthink  = time;
+    this.nextthink  = time;
 
 
-    olddir = normalize(self.velocity);
-    newdir = normalize(self.pos1 - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
-    self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
+    olddir = normalize(this.velocity);
+    newdir = normalize(this.pos1 - this.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+    this.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
 
 
-    UpdateCSQCProjectile(self);
+    UpdateCSQCProjectile(this);
 
 
-    if (IS_DEAD(self.owner) || self.cnt < time || vdist(self.pos1 - self.origin, <, 16))
-        self.use(self, NULL, NULL);
+    if (IS_DEAD(this.owner) || this.cnt < time || vdist(this.pos1 - this.origin, <, 16))
+        this.use(this, NULL, NULL);
 }
 
 void spiderbot_rocket_guided(entity this)
 {
     vector newdir, olddir;
 
 }
 
 void spiderbot_rocket_guided(entity this)
 {
     vector newdir, olddir;
 
-    self.nextthink  = time;
+    this.nextthink  = time;
 
 
-    if(!self.realowner.vehicle)
-        setthink(self, spiderbot_rocket_unguided);
+    if(!this.realowner.vehicle)
+        setthink(this, spiderbot_rocket_unguided);
 
 
-    crosshair_trace(self.realowner);
-    olddir = normalize(self.velocity);
-    newdir = normalize(trace_endpos - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
-    self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
+    crosshair_trace(this.realowner);
+    olddir = normalize(this.velocity);
+    newdir = normalize(trace_endpos - this.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+    this.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
 
 
-    UpdateCSQCProjectile(self);
+    UpdateCSQCProjectile(this);
 
 
-    if (IS_DEAD(self.owner) || self.cnt < time)
-        self.use(self, NULL, NULL);
+    if (IS_DEAD(this.owner) || this.cnt < time)
+        this.use(this, NULL, NULL);
 }
 
 void spiderbot_guide_release(entity this)
 }
 
 void spiderbot_guide_release(entity this)
index ba75c98c5ce1bc7520196c2cc08bb0c635f511f7..91aece258e0defa4272e82ffe663245a7aca2640 100644 (file)
@@ -154,7 +154,7 @@ bool W_Arc_Beam_Send(entity this, entity to, int sf)
        // - The owner client has no use for beam start position or directions,
        //    it always figures this information out for itself with csqc code.
        // - Spectating the owner also truncates this information.
        // - The owner client has no use for beam start position or directions,
        //    it always figures this information out for itself with csqc code.
        // - Spectating the owner also truncates this information.
-       float drawlocal = ((to == self.owner) || ((to.enemy == self.owner) && IS_SPEC(to)));
+       float drawlocal = ((to == this.owner) || ((to.enemy == this.owner) && IS_SPEC(to)));
        if(drawlocal) { sf &= ~ARC_SF_LOCALMASK; }
 
        WriteByte(MSG_ENTITY, sf);
        if(drawlocal) { sf &= ~ARC_SF_LOCALMASK; }
 
        WriteByte(MSG_ENTITY, sf);
@@ -173,25 +173,25 @@ bool W_Arc_Beam_Send(entity this, entity to, int sf)
        }
        if(sf & ARC_SF_START) // starting location
        {
        }
        if(sf & ARC_SF_START) // starting location
        {
-               WriteCoord(MSG_ENTITY, self.beam_start.x);
-               WriteCoord(MSG_ENTITY, self.beam_start.y);
-               WriteCoord(MSG_ENTITY, self.beam_start.z);
+               WriteCoord(MSG_ENTITY, this.beam_start.x);
+               WriteCoord(MSG_ENTITY, this.beam_start.y);
+               WriteCoord(MSG_ENTITY, this.beam_start.z);
        }
        if(sf & ARC_SF_WANTDIR) // want/aim direction
        {
        }
        if(sf & ARC_SF_WANTDIR) // want/aim direction
        {
-               WriteCoord(MSG_ENTITY, self.beam_wantdir.x);
-               WriteCoord(MSG_ENTITY, self.beam_wantdir.y);
-               WriteCoord(MSG_ENTITY, self.beam_wantdir.z);
+               WriteCoord(MSG_ENTITY, this.beam_wantdir.x);
+               WriteCoord(MSG_ENTITY, this.beam_wantdir.y);
+               WriteCoord(MSG_ENTITY, this.beam_wantdir.z);
        }
        if(sf & ARC_SF_BEAMDIR) // beam direction
        {
        }
        if(sf & ARC_SF_BEAMDIR) // beam direction
        {
-               WriteCoord(MSG_ENTITY, self.beam_dir.x);
-               WriteCoord(MSG_ENTITY, self.beam_dir.y);
-               WriteCoord(MSG_ENTITY, self.beam_dir.z);
+               WriteCoord(MSG_ENTITY, this.beam_dir.x);
+               WriteCoord(MSG_ENTITY, this.beam_dir.y);
+               WriteCoord(MSG_ENTITY, this.beam_dir.z);
        }
        if(sf & ARC_SF_BEAMTYPE) // beam type
        {
        }
        if(sf & ARC_SF_BEAMTYPE) // beam type
        {
-               WriteByte(MSG_ENTITY, self.beam_type);
+               WriteByte(MSG_ENTITY, this.beam_type);
        }
 
        return true;
        }
 
        return true;
@@ -233,10 +233,10 @@ void Arc_Player_SetHeat(entity player)
 
 void W_Arc_Bolt_Explode(entity this)
 {
 
 void W_Arc_Bolt_Explode(entity this)
 {
-       self.event_damage = func_null;
-       RadiusDamage(self, self.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), world, world, WEP_CVAR(arc, bolt_force), self.projectiledeathtype, other);
+       this.event_damage = func_null;
+       RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), world, world, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_Arc_Bolt_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_Arc_Bolt_Explode_use(entity this, entity actor, entity trigger)
@@ -262,22 +262,21 @@ void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float dam
 void W_Arc_Bolt_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
 void W_Arc_Bolt_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
-       self.use(this, NULL, NULL);
+       this.use(this, NULL, NULL);
 }
 
 void W_Arc_Attack_Bolt(Weapon thiswep, entity actor)
 {
 }
 
 void W_Arc_Attack_Bolt(Weapon thiswep, entity actor)
 {
-    entity this = actor;
        entity missile;
 
        entity missile;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR(arc, bolt_ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR(arc, bolt_ammo));
 
 
-       W_SetupShot(self, false, 2, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR(arc, bolt_damage));
+       W_SetupShot(actor, false, 2, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR(arc, bolt_damage));
 
        Send_Effect(EFFECT_ARC_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(missile);
 
        Send_Effect(EFFECT_ARC_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(missile);
-       missile.owner = missile.realowner = self;
+       missile.owner = missile.realowner = actor;
        missile.bot_dodge = true;
        missile.bot_dodgerating = WEP_CVAR(arc, bolt_damage);
 
        missile.bot_dodge = true;
        missile.bot_dodgerating = WEP_CVAR(arc, bolt_damage);
 
@@ -305,75 +304,75 @@ void W_Arc_Attack_Bolt(Weapon thiswep, entity actor)
 
        CSQCProjectile(missile, true, PROJECTILE_ARC_BOLT, true);
 
 
        CSQCProjectile(missile, true, PROJECTILE_ARC_BOLT, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 void W_Arc_Beam_Think(entity this)
 {
 }
 
 void W_Arc_Beam_Think(entity this)
 {
-       if(self != self.owner.arc_beam)
+       if(this != this.owner.arc_beam)
        {
        {
-               remove(self);
+               remove(this);
                return;
        }
 
 
        float burst = 0;
                return;
        }
 
 
        float burst = 0;
-       if( (PHYS_INPUT_BUTTON_ATCK2(self.owner) && !WEP_CVAR(arc, bolt)) || self.beam_bursting)
+       if( (PHYS_INPUT_BUTTON_ATCK2(this.owner) && !WEP_CVAR(arc, bolt)) || this.beam_bursting)
        {
        {
-               if(!self.beam_bursting)
-                       self.beam_bursting = true;
+               if(!this.beam_bursting)
+                       this.beam_bursting = true;
                burst = ARC_BT_BURSTMASK;
        }
 
        Weapon thiswep = WEP_ARC;
 
        if(
                burst = ARC_BT_BURSTMASK;
        }
 
        Weapon thiswep = WEP_ARC;
 
        if(
-               !IS_PLAYER(self.owner)
+               !IS_PLAYER(this.owner)
                ||
                ||
-               (self.owner.(thiswep.ammo_field) <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO))
+               (this.owner.(thiswep.ammo_field) <= 0 && !(this.owner.items & IT_UNLIMITED_WEAPON_AMMO))
                ||
                ||
-               IS_DEAD(self.owner)
+               IS_DEAD(this.owner)
                ||
                gameover
                ||
                ||
                gameover
                ||
-               (!PHYS_INPUT_BUTTON_ATCK(self.owner) && !burst )
+               (!PHYS_INPUT_BUTTON_ATCK(this.owner) && !burst )
                ||
                ||
-               STAT(FROZEN, self.owner)
+               STAT(FROZEN, this.owner)
                ||
                ||
-               self.owner.vehicle
+               this.owner.vehicle
                ||
                ||
-               (WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max))
+               (WEP_CVAR(arc, overheat_max) > 0 && this.beam_heat >= WEP_CVAR(arc, overheat_max))
        )
        {
                if ( WEP_CVAR(arc, cooldown) > 0 )
                {
                        float cooldown_speed = 0;
        )
        {
                if ( WEP_CVAR(arc, cooldown) > 0 )
                {
                        float cooldown_speed = 0;
-                       if ( self.beam_heat > WEP_CVAR(arc, overheat_min) && WEP_CVAR(arc, cooldown) > 0 )
+                       if ( this.beam_heat > WEP_CVAR(arc, overheat_min) && WEP_CVAR(arc, cooldown) > 0 )
                        {
                                cooldown_speed = WEP_CVAR(arc, cooldown);
                        }
                        else if ( !burst )
                        {
                        {
                                cooldown_speed = WEP_CVAR(arc, cooldown);
                        }
                        else if ( !burst )
                        {
-                               cooldown_speed = self.beam_heat / WEP_CVAR(arc, beam_refire);
+                               cooldown_speed = this.beam_heat / WEP_CVAR(arc, beam_refire);
                        }
 
                        if ( cooldown_speed )
                        {
                        }
 
                        if ( cooldown_speed )
                        {
-                               if ( WEP_CVAR(arc, cooldown_release) || (WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max)) )
-                                       self.owner.arc_overheat = time + self.beam_heat / cooldown_speed;
-                               self.owner.arc_cooldown = cooldown_speed;
+                               if ( WEP_CVAR(arc, cooldown_release) || (WEP_CVAR(arc, overheat_max) > 0 && this.beam_heat >= WEP_CVAR(arc, overheat_max)) )
+                                       this.owner.arc_overheat = time + this.beam_heat / cooldown_speed;
+                               this.owner.arc_cooldown = cooldown_speed;
                        }
 
                        }
 
-                       if ( WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max) )
+                       if ( WEP_CVAR(arc, overheat_max) > 0 && this.beam_heat >= WEP_CVAR(arc, overheat_max) )
                        {
                                Send_Effect(EFFECT_ARC_OVERHEAT,
                        {
                                Send_Effect(EFFECT_ARC_OVERHEAT,
-                                       self.beam_start, self.beam_wantdir, 1 );
-                               sound(self, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
+                                       this.beam_start, this.beam_wantdir, 1 );
+                               sound(this, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
                        }
                }
 
                        }
                }
 
-               if(self == self.owner.arc_beam) { self.owner.arc_beam = world; }
-               entity own = self.owner;
+               if(this == this.owner.arc_beam) { this.owner.arc_beam = world; }
+               entity own = this.owner;
                Weapon w = WEP_ARC;
                if(!w.wr_checkammo1(w, own) && !w.wr_checkammo2(w, own))
                if(!(own.items & IT_UNLIMITED_WEAPON_AMMO))
                Weapon w = WEP_ARC;
                if(!w.wr_checkammo1(w, own) && !w.wr_checkammo2(w, own))
                if(!(own.items & IT_UNLIMITED_WEAPON_AMMO))
@@ -381,13 +380,13 @@ void W_Arc_Beam_Think(entity this)
                        // note: this doesn't force the switch
                        W_SwitchToOtherWeapon(own);
                }
                        // note: this doesn't force the switch
                        W_SwitchToOtherWeapon(own);
                }
-               remove(self);
+               remove(this);
                return;
        }
 
        // decrease ammo
        float coefficient = frametime;
                return;
        }
 
        // decrease ammo
        float coefficient = frametime;
-       if(!(self.owner.items & IT_UNLIMITED_WEAPON_AMMO))
+       if(!(this.owner.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                float rootammo;
                if(burst)
        {
                float rootammo;
                if(burst)
@@ -397,17 +396,17 @@ void W_Arc_Beam_Think(entity this)
 
                if(rootammo)
                {
 
                if(rootammo)
                {
-                       coefficient = min(coefficient, self.owner.(thiswep.ammo_field) / rootammo);
-                       self.owner.(thiswep.ammo_field) = max(0, self.owner.(thiswep.ammo_field) - (rootammo * frametime));
+                       coefficient = min(coefficient, this.owner.(thiswep.ammo_field) / rootammo);
+                       this.owner.(thiswep.ammo_field) = max(0, this.owner.(thiswep.ammo_field) - (rootammo * frametime));
                }
        }
        float heat_speed = burst ? WEP_CVAR(arc, burst_heat) : WEP_CVAR(arc, beam_heat);
                }
        }
        float heat_speed = burst ? WEP_CVAR(arc, burst_heat) : WEP_CVAR(arc, beam_heat);
-       self.beam_heat = min( WEP_CVAR(arc, overheat_max), self.beam_heat + heat_speed*frametime );
+       this.beam_heat = min( WEP_CVAR(arc, overheat_max), this.beam_heat + heat_speed*frametime );
 
 
-       makevectors(self.owner.v_angle);
+       makevectors(this.owner.v_angle);
 
        W_SetupShot_Range(
 
        W_SetupShot_Range(
-               self.owner,
+               this.owner,
                true,
                0,
                SND_Null,
                true,
                0,
                SND_Null,
@@ -417,44 +416,44 @@ void W_Arc_Beam_Think(entity this)
        );
 
        // After teleport, "lock" the beam until the teleport is confirmed.
        );
 
        // After teleport, "lock" the beam until the teleport is confirmed.
-       if (time < self.beam_teleporttime + ANTILAG_LATENCY(self.owner)) {
-               w_shotdir = self.beam_dir;
+       if (time < this.beam_teleporttime + ANTILAG_LATENCY(this.owner)) {
+               w_shotdir = this.beam_dir;
        }
 
        // network information: shot origin and want/aim direction
        }
 
        // network information: shot origin and want/aim direction
-       if(self.beam_start != w_shotorg)
+       if(this.beam_start != w_shotorg)
        {
        {
-               self.SendFlags |= ARC_SF_START;
-               self.beam_start = w_shotorg;
+               this.SendFlags |= ARC_SF_START;
+               this.beam_start = w_shotorg;
        }
        }
-       if(self.beam_wantdir != w_shotdir)
+       if(this.beam_wantdir != w_shotdir)
        {
        {
-               self.SendFlags |= ARC_SF_WANTDIR;
-               self.beam_wantdir = w_shotdir;
+               this.SendFlags |= ARC_SF_WANTDIR;
+               this.beam_wantdir = w_shotdir;
        }
 
        }
 
-       if(!self.beam_initialized)
+       if(!this.beam_initialized)
        {
        {
-               self.beam_dir = w_shotdir;
-               self.beam_initialized = true;
+               this.beam_dir = w_shotdir;
+               this.beam_initialized = true;
        }
 
        // WEAPONTODO: Detect player velocity so that the beam curves when moving too
        }
 
        // WEAPONTODO: Detect player velocity so that the beam curves when moving too
-       // idea: blend together self.beam_dir with the inverted direction the player is moving in
+       // idea: blend together this.beam_dir with the inverted direction the player is moving in
        // might have to make some special accomodation so that it only uses view_right and view_up
 
        // note that if we do this, it'll always be corrected to a maximum angle by beam_maxangle handling
 
        float segments;
        // might have to make some special accomodation so that it only uses view_right and view_up
 
        // note that if we do this, it'll always be corrected to a maximum angle by beam_maxangle handling
 
        float segments;
-       if(self.beam_dir != w_shotdir)
+       if(this.beam_dir != w_shotdir)
        {
                // calculate how much we're going to move the end of the beam to the want position
                // WEAPONTODO (server and client):
                // blendfactor never actually becomes 0 in this situation, which is a problem
        {
                // calculate how much we're going to move the end of the beam to the want position
                // WEAPONTODO (server and client):
                // blendfactor never actually becomes 0 in this situation, which is a problem
-               // regarding precision... this means that self.beam_dir and w_shotdir approach
+               // regarding precision... this means that this.beam_dir and w_shotdir approach
                // eachother, however they never actually become the same value with this method.
                // Perhaps we should do some form of rounding/snapping?
                // eachother, however they never actually become the same value with this method.
                // Perhaps we should do some form of rounding/snapping?
-               float angle = vlen(w_shotdir - self.beam_dir) * RAD2DEG;
+               float angle = vlen(w_shotdir - this.beam_dir) * RAD2DEG;
                if(angle && (angle > WEP_CVAR(arc, beam_maxangle)))
                {
                        // if the angle is greater than maxangle, force the blendfactor to make this the maximum factor
                if(angle && (angle > WEP_CVAR(arc, beam_maxangle)))
                {
                        // if the angle is greater than maxangle, force the blendfactor to make this the maximum factor
@@ -463,7 +462,7 @@ void W_Arc_Beam_Think(entity this)
                                (1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
                                min(WEP_CVAR(arc, beam_maxangle) / angle, 1)
                        );
                                (1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
                                min(WEP_CVAR(arc, beam_maxangle) / angle, 1)
                        );
-                       self.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (self.beam_dir * blendfactor));
+                       this.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
                }
                else
                {
                }
                else
                {
@@ -473,11 +472,11 @@ void W_Arc_Beam_Think(entity this)
                                (1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
                                1
                        );
                                (1 - (WEP_CVAR(arc, beam_returnspeed) * frametime)),
                                1
                        );
-                       self.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (self.beam_dir * blendfactor));
+                       this.beam_dir = normalize((w_shotdir * (1 - blendfactor)) + (this.beam_dir * blendfactor));
                }
 
                // network information: beam direction
                }
 
                // network information: beam direction
-               self.SendFlags |= ARC_SF_BEAMDIR;
+               this.SendFlags |= ARC_SF_BEAMDIR;
 
                // calculate how many segments are needed
                float max_allowed_segments;
 
                // calculate how many segments are needed
                float max_allowed_segments;
@@ -510,7 +509,7 @@ void W_Arc_Beam_Think(entity this)
        }
        else { segments = 1; }
 
        }
        else { segments = 1; }
 
-       vector beam_endpos = (w_shotorg + (self.beam_dir * WEP_CVAR(arc, beam_range)));
+       vector beam_endpos = (w_shotorg + (this.beam_dir * WEP_CVAR(arc, beam_range)));
        vector beam_controlpoint = w_shotorg + w_shotdir * (WEP_CVAR(arc, beam_range) * (1 - WEP_CVAR(arc, beam_tightness)));
 
        float i;
        vector beam_controlpoint = w_shotorg + w_shotdir * (WEP_CVAR(arc, beam_range) * (1 - WEP_CVAR(arc, beam_tightness)));
 
        float i;
@@ -532,12 +531,12 @@ void W_Arc_Beam_Think(entity this)
                vector new_dir = normalize(new_origin - last_origin);
 
                WarpZone_traceline_antilag(
                vector new_dir = normalize(new_origin - last_origin);
 
                WarpZone_traceline_antilag(
-                       self.owner,
+                       this.owner,
                        last_origin,
                        new_origin,
                        MOVE_NORMAL,
                        last_origin,
                        new_origin,
                        MOVE_NORMAL,
-                       self.owner,
-                       ANTILAG_LATENCY(self.owner)
+                       this.owner,
+                       ANTILAG_LATENCY(this.owner)
                );
 
                // Do all the transforms for warpzones right now, as we already
                );
 
                // Do all the transforms for warpzones right now, as we already
@@ -571,7 +570,7 @@ void W_Arc_Beam_Think(entity this)
                                vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, hitorigin) - w_shotorg)
                        );
 
                                vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, hitorigin) - w_shotorg)
                        );
 
-                       if(is_player && SAME_TEAM(self.owner, trace_ent))
+                       if(is_player && SAME_TEAM(this.owner, trace_ent))
                        {
                                float roothealth, rootarmor;
                                if(burst)
                        {
                                float roothealth, rootarmor;
                                if(burst)
@@ -627,10 +626,10 @@ void W_Arc_Beam_Think(entity this)
                                else
                                        { rootdamage = WEP_CVAR(arc, beam_nonplayerdamage); }
 
                                else
                                        { rootdamage = WEP_CVAR(arc, beam_nonplayerdamage); }
 
-                               if(accuracy_isgooddamage(self.owner, trace_ent))
+                               if(accuracy_isgooddamage(this.owner, trace_ent))
                                {
                                        accuracy_add(
                                {
                                        accuracy_add(
-                                               self.owner,
+                                               this.owner,
                                                WEP_ARC.m_id,
                                                0,
                                                rootdamage * coefficient * falloff
                                                WEP_ARC.m_id,
                                                0,
                                                rootdamage * coefficient * falloff
@@ -639,8 +638,8 @@ void W_Arc_Beam_Think(entity this)
 
                                Damage(
                                        trace_ent,
 
                                Damage(
                                        trace_ent,
-                                       self.owner,
-                                       self.owner,
+                                       this.owner,
+                                       this.owner,
                                        rootdamage * coefficient * falloff,
                                        WEP_ARC.m_id,
                                        hitorigin,
                                        rootdamage * coefficient * falloff,
                                        WEP_ARC.m_id,
                                        hitorigin,
@@ -665,27 +664,27 @@ void W_Arc_Beam_Think(entity this)
        new_beam_type |= burst;
 
        // network information: beam type
        new_beam_type |= burst;
 
        // network information: beam type
-       if(new_beam_type != self.beam_type)
+       if(new_beam_type != this.beam_type)
        {
        {
-               self.SendFlags |= ARC_SF_BEAMTYPE;
-               self.beam_type = new_beam_type;
+               this.SendFlags |= ARC_SF_BEAMTYPE;
+               this.beam_type = new_beam_type;
        }
 
        }
 
-       self.owner.beam_prev = time;
-       self.nextthink = time;
+       this.owner.beam_prev = time;
+       this.nextthink = time;
 }
 
 void W_Arc_Beam(float burst, entity actor)
 }
 
 void W_Arc_Beam(float burst, entity actor)
-{entity this = actor;
+{
 
        // only play fire sound if 1 sec has passed since player let go the fire button
 
        // only play fire sound if 1 sec has passed since player let go the fire button
-       if(time - self.beam_prev > 1)
-               sound(self, CH_WEAPON_A, SND_ARC_FIRE, VOL_BASE, ATTN_NORM);
+       if(time - actor.beam_prev > 1)
+               sound(actor, CH_WEAPON_A, SND_ARC_FIRE, VOL_BASE, ATTN_NORM);
 
 
-       entity beam = self.arc_beam = new(W_Arc_Beam);
+       entity beam = actor.arc_beam = new(W_Arc_Beam);
        beam.solid = SOLID_NOT;
        setthink(beam, W_Arc_Beam_Think);
        beam.solid = SOLID_NOT;
        setthink(beam, W_Arc_Beam_Think);
-       beam.owner = self;
+       beam.owner = actor;
        beam.movetype = MOVETYPE_NONE;
        beam.bot_dodge = true;
        beam.bot_dodgerating = WEP_CVAR(arc, beam_damage);
        beam.movetype = MOVETYPE_NONE;
        beam.bot_dodge = true;
        beam.bot_dodgerating = WEP_CVAR(arc, beam_damage);
@@ -695,48 +694,47 @@ void W_Arc_Beam(float burst, entity actor)
        WITHSELF(beam, getthink(beam)(beam));
 }
 void Arc_Smoke(entity actor)
        WITHSELF(beam, getthink(beam)(beam));
 }
 void Arc_Smoke(entity actor)
-{entity this = actor;
-       makevectors(self.v_angle);
-       W_SetupShot_Range(self,true,0,SND_Null,0,0,0);
+{
+       makevectors(actor.v_angle);
+       W_SetupShot_Range(actor,true,0,SND_Null,0,0,0);
 
 
-       vector smoke_origin = w_shotorg + self.velocity*frametime;
-       if ( self.arc_overheat > time )
+       vector smoke_origin = w_shotorg + actor.velocity*frametime;
+       if ( actor.arc_overheat > time )
        {
        {
-               if ( random() < self.arc_heat_percent )
+               if ( random() < actor.arc_heat_percent )
                        Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
                        Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
-               if ( PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self) )
+               if ( PHYS_INPUT_BUTTON_ATCK(actor) || PHYS_INPUT_BUTTON_ATCK2(actor) )
                {
                        Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
                {
                        Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
-                       if ( !self.arc_smoke_sound )
+                       if ( !actor.arc_smoke_sound )
                        {
                        {
-                               self.arc_smoke_sound = 1;
-                               sound(self, CH_SHOTS_SINGLE, SND_ARC_LOOP_OVERHEAT, VOL_BASE, ATTN_NORM);
+                               actor.arc_smoke_sound = 1;
+                               sound(actor, CH_SHOTS_SINGLE, SND_ARC_LOOP_OVERHEAT, VOL_BASE, ATTN_NORM);
                        }
                }
        }
                        }
                }
        }
-       else if ( self.arc_beam && WEP_CVAR(arc, overheat_max) > 0 &&
-                       self.arc_beam.beam_heat > WEP_CVAR(arc, overheat_min) )
+       else if ( actor.arc_beam && WEP_CVAR(arc, overheat_max) > 0 &&
+                       actor.arc_beam.beam_heat > WEP_CVAR(arc, overheat_min) )
        {
        {
-               if ( random() < (self.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
+               if ( random() < (actor.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
                                ( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
                        Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
        }
 
                                ( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
                        Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
        }
 
-       if (  self.arc_smoke_sound && ( self.arc_overheat <= time ||
-               !( PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self) ) ) || PS(self).m_switchweapon != WEP_ARC )
+       if (  actor.arc_smoke_sound && ( actor.arc_overheat <= time ||
+               !( PHYS_INPUT_BUTTON_ATCK(actor) || PHYS_INPUT_BUTTON_ATCK2(actor) ) ) || PS(actor).m_switchweapon != WEP_ARC )
        {
        {
-               self.arc_smoke_sound = 0;
-               sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
+               actor.arc_smoke_sound = 0;
+               sound(actor, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
        }
 }
 
 METHOD(Arc, wr_aim, void(entity thiswep, entity actor))
 {
        }
 }
 
 METHOD(Arc, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     if(WEP_CVAR(arc, beam_botaimspeed))
     {
     if(WEP_CVAR(arc, beam_botaimspeed))
     {
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
-               self,
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(
+               actor,
             WEP_CVAR(arc, beam_botaimspeed),
             0,
             WEP_CVAR(arc, beam_botaimlifetime),
             WEP_CVAR(arc, beam_botaimspeed),
             0,
             WEP_CVAR(arc, beam_botaimlifetime),
@@ -745,8 +743,8 @@ METHOD(Arc, wr_aim, void(entity thiswep, entity actor))
     }
     else
     {
     }
     else
     {
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
-               self,
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(
+               actor,
             1000000,
             0,
             0.001,
             1000000,
             0,
             0.001,
@@ -855,20 +853,18 @@ METHOD(Arc, wr_killmessage, Notification(entity thiswep))
 }
 METHOD(Arc, wr_drop, void(entity thiswep, entity actor))
 {
 }
 METHOD(Arc, wr_drop, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    weapon_dropevent_item.arc_overheat = self.arc_overheat;
-    weapon_dropevent_item.arc_cooldown = self.arc_cooldown;
-    self.arc_overheat = 0;
-    self.arc_cooldown = 0;
+    weapon_dropevent_item.arc_overheat = actor.arc_overheat;
+    weapon_dropevent_item.arc_cooldown = actor.arc_cooldown;
+    actor.arc_overheat = 0;
+    actor.arc_cooldown = 0;
 }
 METHOD(Arc, wr_pickup, void(entity thiswep, entity actor))
 {
 }
 METHOD(Arc, wr_pickup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    if ( !client_hasweapon(self, thiswep, false, false) &&
+    if ( !client_hasweapon(actor, thiswep, false, false) &&
         weapon_dropevent_item.arc_overheat > time )
     {
         weapon_dropevent_item.arc_overheat > time )
     {
-        self.arc_overheat = weapon_dropevent_item.arc_overheat;
-        self.arc_cooldown = weapon_dropevent_item.arc_cooldown;
+        actor.arc_overheat = weapon_dropevent_item.arc_overheat;
+        actor.arc_cooldown = weapon_dropevent_item.arc_cooldown;
     }
 }
 #endif
     }
 }
 #endif
@@ -877,13 +873,12 @@ bool autocvar_cl_arcbeam_teamcolor = true;
 
 METHOD(Arc, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Arc, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         vector org2;
         org2 = w_org + w_backoff * 6;
         pointparticles(EFFECT_ARC_BOLT_EXPLODE, org2, w_backoff * 1000, 1);
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         vector org2;
         org2 = w_org + w_backoff * 6;
         pointparticles(EFFECT_ARC_BOLT_EXPLODE, org2, w_backoff * 1000, 1);
-        if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
+        if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
     }
 }
 
     }
 }
 
index 394d50c6946c76007c9f70fff3d60da78c1b94ba..59cb4618bc1cf130cc098b8fcd5b391a69b0602d 100644 (file)
@@ -60,22 +60,22 @@ void W_Blaster_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
 
 {
        PROJECTILE_TOUCH(this);
 
-       self.event_damage = func_null;
+       this.event_damage = func_null;
 
        RadiusDamage(
 
        RadiusDamage(
-               self,
-               self.realowner,
-               self.blaster_damage,
-               self.blaster_edgedamage,
-               self.blaster_radius,
+               this,
+               this.realowner,
+               this.blaster_damage,
+               this.blaster_edgedamage,
+               this.blaster_radius,
                world,
                world,
                world,
                world,
-               self.blaster_force,
-               self.projectiledeathtype,
+               this.blaster_force,
+               this.projectiledeathtype,
                other
        );
 
                other
        );
 
-       remove(self);
+       remove(this);
 }
 
 void W_Blaster_Think(entity this)
 }
 
 void W_Blaster_Think(entity this)
@@ -152,16 +152,15 @@ void W_Blaster_Attack(
 
 METHOD(Blaster, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(Blaster, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     if(WEP_CVAR(blaster, secondary))
     {
         if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage))
     if(WEP_CVAR(blaster, secondary))
     {
         if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage))
-            { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
+            { PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
         else
         else
-            { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+            { PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
     }
     else
     }
     else
-        { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+        { PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
 }
 
 METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponentity, int fire))
 }
 
 METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponentity, int fire))
@@ -225,8 +224,7 @@ METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponenti
 
 METHOD(Blaster, wr_setup, void(entity thiswep, entity actor))
 {
 
 METHOD(Blaster, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.ammo_field = ammo_none;
+    actor.ammo_field = ammo_none;
 }
 
 METHOD(Blaster, wr_checkammo1, bool(entity thiswep, entity actor))
 }
 
 METHOD(Blaster, wr_checkammo1, bool(entity thiswep, entity actor))
@@ -254,11 +252,10 @@ METHOD(Blaster, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Blaster, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Blaster, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 6;
     pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
     vector org2;
     org2 = w_org + w_backoff * 6;
     pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
-    if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
+    if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
 }
 
 #endif
 }
 
 #endif
index a582f9843bf7047d884aa77fa9bbd6f773c99616..51932f6fef07869cf352896bec553d3ccaccb0c0 100644 (file)
@@ -233,15 +233,15 @@ void W_Crylink_LinkJoinEffect_Think(entity this)
        // is there at least 2 projectiles very close?
        entity e, p;
        float n;
        // is there at least 2 projectiles very close?
        entity e, p;
        float n;
-       e = self.owner.crylink_lastgroup;
+       e = this.owner.crylink_lastgroup;
        n = 0;
        if(e)
        {
        n = 0;
        if(e)
        {
-               if(vlen(e.origin - self.origin) < vlen(e.velocity) * frametime)
+               if(vlen(e.origin - this.origin) < vlen(e.velocity) * frametime)
                        ++n;
                for(p = e; (p = p.queuenext) != e; )
                {
                        ++n;
                for(p = e; (p = p.queuenext) != e; )
                {
-                       if(vlen(p.origin - self.origin) < vlen(p.velocity) * frametime)
+                       if(vlen(p.origin - this.origin) < vlen(p.velocity) * frametime)
                                ++n;
                }
                if(n >= 2)
                                ++n;
                }
                if(n >= 2)
@@ -263,11 +263,11 @@ void W_Crylink_LinkJoinEffect_Think(entity this)
                                        e.projectiledeathtype,
                                        other
                                );
                                        e.projectiledeathtype,
                                        other
                                );
-                               Send_Effect(EFFECT_CRYLINK_JOINEXPLODE, self.origin, '0 0 0', n);
+                               Send_Effect(EFFECT_CRYLINK_JOINEXPLODE, this.origin, '0 0 0', n);
                        }
                }
        }
                        }
                }
        }
-       remove(self);
+       remove(this);
 }
 
 float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
 }
 
 float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
@@ -297,13 +297,13 @@ void W_Crylink_Touch(entity this)
 {
        float finalhit;
        float f;
 {
        float finalhit;
        float f;
-       float isprimary = !(self.projectiledeathtype & HITTYPE_SECONDARY);
+       float isprimary = !(this.projectiledeathtype & HITTYPE_SECONDARY);
        PROJECTILE_TOUCH(this);
 
        float a;
        PROJECTILE_TOUCH(this);
 
        float a;
-       a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
+       a = bound(0, 1 - (time - this.fade_time) * this.fade_rate, 1);
 
 
-       finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
+       finalhit = ((this.cnt <= 0) || (other.takedamage != DAMAGE_NO));
        if(finalhit)
                f = 1;
        else
        if(finalhit)
                f = 1;
        else
@@ -311,28 +311,28 @@ void W_Crylink_Touch(entity this)
        if(a)
                f *= a;
 
        if(a)
                f *= a;
 
-       float totaldamage = RadiusDamage(self, self.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * f, self.projectiledeathtype, other);
+       float totaldamage = RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * f, this.projectiledeathtype, other);
 
 
-       if(totaldamage && ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 2) || ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 1) && !W_Crylink_Touch_WouldHitFriendly(self, WEP_CVAR_BOTH(crylink, isprimary, radius)))))
+       if(totaldamage && ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 2) || ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 1) && !W_Crylink_Touch_WouldHitFriendly(this, WEP_CVAR_BOTH(crylink, isprimary, radius)))))
        {
        {
-               if(self == self.realowner.crylink_lastgroup)
-                       self.realowner.crylink_lastgroup = world;
-               W_Crylink_LinkExplode(self.queuenext, self);
-               self.classname = "spike_oktoremove";
-               remove(self);
+               if(this == this.realowner.crylink_lastgroup)
+                       this.realowner.crylink_lastgroup = world;
+               W_Crylink_LinkExplode(this.queuenext, this);
+               this.classname = "spike_oktoremove";
+               remove(this);
                return;
        }
        else if(finalhit)
        {
                // just unlink
                return;
        }
        else if(finalhit)
        {
                // just unlink
-               W_Crylink_Dequeue(self);
-               remove(self);
+               W_Crylink_Dequeue(this);
+               remove(this);
                return;
        }
                return;
        }
-       self.cnt = self.cnt - 1;
-       self.angles = vectoangles(self.velocity);
-       self.owner = world;
-       self.projectiledeathtype |= HITTYPE_BOUNCE;
+       this.cnt = this.cnt - 1;
+       this.angles = vectoangles(this.velocity);
+       this.owner = world;
+       this.projectiledeathtype |= HITTYPE_BOUNCE;
        // commented out as it causes a little hitch...
        //if(proj.cnt == 0)
        //      CSQCProjectile(proj, true, PROJECTILE_CRYLINK, true);
        // commented out as it causes a little hitch...
        //if(proj.cnt == 0)
        //      CSQCProjectile(proj, true, PROJECTILE_CRYLINK, true);
@@ -340,26 +340,26 @@ void W_Crylink_Touch(entity this)
 
 void W_Crylink_Fadethink(entity this)
 {
 
 void W_Crylink_Fadethink(entity this)
 {
-       W_Crylink_Dequeue(self);
-       remove(self);
+       W_Crylink_Dequeue(this);
+       remove(this);
 }
 
 void W_Crylink_Attack(Weapon thiswep, entity actor)
 }
 
 void W_Crylink_Attack(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        float counter, shots;
        entity proj, prevproj, firstproj;
        vector s;
        vector forward, right, up;
        float maxdmg;
 
        float counter, shots;
        entity proj, prevproj, firstproj;
        vector s;
        vector forward, right, up;
        float maxdmg;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(crylink, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(crylink, ammo));
 
        maxdmg = WEP_CVAR_PRI(crylink, damage) * WEP_CVAR_PRI(crylink, shots);
        maxdmg *= 1 + WEP_CVAR_PRI(crylink, bouncedamagefactor) * WEP_CVAR_PRI(crylink, bounces);
        if(WEP_CVAR_PRI(crylink, joinexplode))
                maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage);
 
 
        maxdmg = WEP_CVAR_PRI(crylink, damage) * WEP_CVAR_PRI(crylink, shots);
        maxdmg *= 1 + WEP_CVAR_PRI(crylink, bouncedamagefactor) * WEP_CVAR_PRI(crylink, bounces);
        if(WEP_CVAR_PRI(crylink, joinexplode))
                maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage);
 
-       W_SetupShot(self, false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, maxdmg);
+       W_SetupShot(actor, false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, maxdmg);
        forward = v_forward;
        right = v_right;
        up = v_up;
        forward = v_forward;
        right = v_right;
        up = v_up;
@@ -371,7 +371,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor)
        {
                proj = new(spike);
                proj.reset = W_Crylink_Reset;
        {
                proj = new(spike);
                proj.reset = W_Crylink_Reset;
-               proj.realowner = proj.owner = self;
+               proj.realowner = proj.owner = actor;
                proj.bot_dodge = true;
                proj.bot_dodgerating = WEP_CVAR_PRI(crylink, damage);
                if(shots == 1) {
                proj.bot_dodge = true;
                proj.bot_dodgerating = WEP_CVAR_PRI(crylink, damage);
                if(shots == 1) {
@@ -442,32 +442,32 @@ void W_Crylink_Attack(Weapon thiswep, entity actor)
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
 
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
 
-               MUTATOR_CALLHOOK(EditProjectile, self, proj);
+               MUTATOR_CALLHOOK(EditProjectile, actor, proj);
        }
        if(WEP_CVAR_PRI(crylink, joinspread) != 0)
        {
        }
        if(WEP_CVAR_PRI(crylink, joinspread) != 0)
        {
-               self.crylink_lastgroup = proj;
+               actor.crylink_lastgroup = proj;
                W_Crylink_CheckLinks(proj);
                W_Crylink_CheckLinks(proj);
-               self.crylink_waitrelease = 1;
+               actor.crylink_waitrelease = 1;
        }
 }
 
 void W_Crylink_Attack2(Weapon thiswep, entity actor)
        }
 }
 
 void W_Crylink_Attack2(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        float counter, shots;
        entity proj, prevproj, firstproj;
        vector s;
        vector forward, right, up;
        float maxdmg;
 
        float counter, shots;
        entity proj, prevproj, firstproj;
        vector s;
        vector forward, right, up;
        float maxdmg;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(crylink, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(crylink, ammo));
 
        maxdmg = WEP_CVAR_SEC(crylink, damage) * WEP_CVAR_SEC(crylink, shots);
        maxdmg *= 1 + WEP_CVAR_SEC(crylink, bouncedamagefactor) * WEP_CVAR_SEC(crylink, bounces);
        if(WEP_CVAR_SEC(crylink, joinexplode))
                maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage);
 
 
        maxdmg = WEP_CVAR_SEC(crylink, damage) * WEP_CVAR_SEC(crylink, shots);
        maxdmg *= 1 + WEP_CVAR_SEC(crylink, bouncedamagefactor) * WEP_CVAR_SEC(crylink, bounces);
        if(WEP_CVAR_SEC(crylink, joinexplode))
                maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage);
 
-       W_SetupShot(self, false, 2, SND_CRYLINK_FIRE2, CH_WEAPON_A, maxdmg);
+       W_SetupShot(actor, false, 2, SND_CRYLINK_FIRE2, CH_WEAPON_A, maxdmg);
        forward = v_forward;
        right = v_right;
        up = v_up;
        forward = v_forward;
        right = v_right;
        up = v_up;
@@ -479,7 +479,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor)
        {
                proj = new(spike);
                proj.reset = W_Crylink_Reset;
        {
                proj = new(spike);
                proj.reset = W_Crylink_Reset;
-               proj.realowner = proj.owner = self;
+               proj.realowner = proj.owner = actor;
                proj.bot_dodge = true;
                proj.bot_dodgerating = WEP_CVAR_SEC(crylink, damage);
                if(shots == 1) {
                proj.bot_dodge = true;
                proj.bot_dodgerating = WEP_CVAR_SEC(crylink, damage);
                if(shots == 1) {
@@ -557,23 +557,22 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor)
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
 
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
 
-               MUTATOR_CALLHOOK(EditProjectile, self, proj);
+               MUTATOR_CALLHOOK(EditProjectile, actor, proj);
        }
        if(WEP_CVAR_SEC(crylink, joinspread) != 0)
        {
        }
        if(WEP_CVAR_SEC(crylink, joinspread) != 0)
        {
-               self.crylink_lastgroup = proj;
+               actor.crylink_lastgroup = proj;
                W_Crylink_CheckLinks(proj);
                W_Crylink_CheckLinks(proj);
-               self.crylink_waitrelease = 2;
+               actor.crylink_waitrelease = 2;
        }
 }
 
 METHOD(Crylink, wr_aim, void(entity thiswep, entity actor))
 {
        }
 }
 
 METHOD(Crylink, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     if(random() < 0.10)
     if(random() < 0.10)
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
     else
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
 }
 METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -667,20 +666,19 @@ METHOD(Crylink, wr_killmessage, Notification(entity thiswep))
 #ifdef CSQC
 METHOD(Crylink, wr_impacteffect, void(entity thiswep, entity actor))
 {
 #ifdef CSQC
 METHOD(Crylink, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_CRYLINK_IMPACT2, org2, '0 0 0', 1);
         if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_CRYLINK_IMPACT2, org2, '0 0 0', 1);
         if(!w_issilent)
-            sound(self, CH_SHOTS, SND_CRYLINK_IMPACT2, VOL_BASE, ATTN_NORM);
+            sound(actor, CH_SHOTS, SND_CRYLINK_IMPACT2, VOL_BASE, ATTN_NORM);
     }
     else
     {
         pointparticles(EFFECT_CRYLINK_IMPACT, org2, '0 0 0', 1);
         if(!w_issilent)
     }
     else
     {
         pointparticles(EFFECT_CRYLINK_IMPACT, org2, '0 0 0', 1);
         if(!w_issilent)
-            sound(self, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM);
+            sound(actor, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM);
     }
 }
 #endif
     }
 }
 #endif
index 275c375f3d154259c812af2f61563307d0a49f0c..fe3a19a0b4bbe56e1e509bc893aa70f07701c2b6 100644 (file)
@@ -74,75 +74,75 @@ spawnfunc(weapon_rocketlauncher) { spawnfunc_weapon_devastator(this); }
 
 void W_Devastator_Unregister(entity this)
 {
 
 void W_Devastator_Unregister(entity this)
 {
-       if(self.realowner && self.realowner.lastrocket == self)
+       if(this.realowner && this.realowner.lastrocket == this)
        {
        {
-               self.realowner.lastrocket = world;
-               // self.realowner.rl_release = 1;
+               this.realowner.lastrocket = world;
+               // this.realowner.rl_release = 1;
        }
 }
 
 void W_Devastator_Explode(entity this)
 {
        }
 }
 
 void W_Devastator_Explode(entity this)
 {
-       W_Devastator_Unregister(self);
+       W_Devastator_Unregister(this);
 
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
 
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
-                       if(DIFF_TEAM(self.realowner, other))
+                       if(DIFF_TEAM(this.realowner, other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
-                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
+                                               Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
        RadiusDamage(
 
        RadiusDamage(
-               self,
-               self.realowner,
+               this,
+               this.realowner,
                WEP_CVAR(devastator, damage),
                WEP_CVAR(devastator, edgedamage),
                WEP_CVAR(devastator, radius),
                world,
                world,
                WEP_CVAR(devastator, force),
                WEP_CVAR(devastator, damage),
                WEP_CVAR(devastator, edgedamage),
                WEP_CVAR(devastator, radius),
                world,
                world,
                WEP_CVAR(devastator, force),
-               self.projectiledeathtype,
+               this.projectiledeathtype,
                other
        );
 
        Weapon thiswep = WEP_DEVASTATOR;
                other
        );
 
        Weapon thiswep = WEP_DEVASTATOR;
-       if(PS(self.realowner).m_weapon == thiswep)
+       if(PS(this.realowner).m_weapon == thiswep)
        {
        {
-               if(self.realowner.(thiswep.ammo_field) < WEP_CVAR(devastator, ammo))
-               if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(this.realowner.(thiswep.ammo_field) < WEP_CVAR(devastator, ammo))
+               if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                {
-                       self.realowner.cnt = WEP_DEVASTATOR.m_id;
+                       this.realowner.cnt = WEP_DEVASTATOR.m_id;
                        int slot = 0; // TODO: unhardcode
                        int slot = 0; // TODO: unhardcode
-                       ATTACK_FINISHED(self.realowner, slot) = time;
-                       PS(self.realowner).m_switchweapon = w_getbestweapon(self.realowner);
+                       ATTACK_FINISHED(this.realowner, slot) = time;
+                       PS(this.realowner).m_switchweapon = w_getbestweapon(this.realowner);
                }
        }
                }
        }
-       remove(self);
+       remove(this);
 }
 
 void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
 {
 }
 
 void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
 {
-       W_Devastator_Unregister(self);
+       W_Devastator_Unregister(this);
 
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
        float handled_as_rocketjump = false;
 
        entity head = WarpZone_FindRadius(
 
        float handled_as_rocketjump = false;
 
        entity head = WarpZone_FindRadius(
-               self.origin,
+               this.origin,
                WEP_CVAR(devastator, remote_jump_radius),
                false
        );
 
        while(head)
        {
                WEP_CVAR(devastator, remote_jump_radius),
                false
        );
 
        while(head)
        {
-               if(head.takedamage && (head == self.realowner))
+               if(head.takedamage && (head == this.realowner))
                {
                {
-                       float distance_to_head = vlen(self.origin - head.WarpZone_findradius_nearest);
+                       float distance_to_head = vlen(this.origin - head.WarpZone_findradius_nearest);
                        if(distance_to_head <= WEP_CVAR(devastator, remote_jump_radius))
                        {
                                // we handled this as a rocketjump :)
                        if(distance_to_head <= WEP_CVAR(devastator, remote_jump_radius))
                        {
                                // we handled this as a rocketjump :)
@@ -159,7 +159,7 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
 
                                // now do the damage
                                RadiusDamage(
 
                                // now do the damage
                                RadiusDamage(
-                                       self,
+                                       this,
                                        head,
                                        WEP_CVAR(devastator, remote_jump_damage),
                                        WEP_CVAR(devastator, remote_jump_damage),
                                        head,
                                        WEP_CVAR(devastator, remote_jump_damage),
                                        WEP_CVAR(devastator, remote_jump_damage),
@@ -167,7 +167,7 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
                                        world,
                                        head,
                                        0,
                                        world,
                                        head,
                                        0,
-                                       self.projectiledeathtype | HITTYPE_BOUNCE,
+                                       this.projectiledeathtype | HITTYPE_BOUNCE,
                                        world
                                );
                                break;
                                        world
                                );
                                break;
@@ -177,44 +177,44 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
        }
 
        RadiusDamage(
        }
 
        RadiusDamage(
-               self,
-               self.realowner,
+               this,
+               this.realowner,
                WEP_CVAR(devastator, remote_damage),
                WEP_CVAR(devastator, remote_edgedamage),
                WEP_CVAR(devastator, remote_radius),
                (handled_as_rocketjump ? head : world),
                world,
                WEP_CVAR(devastator, remote_force),
                WEP_CVAR(devastator, remote_damage),
                WEP_CVAR(devastator, remote_edgedamage),
                WEP_CVAR(devastator, remote_radius),
                (handled_as_rocketjump ? head : world),
                world,
                WEP_CVAR(devastator, remote_force),
-               self.projectiledeathtype | HITTYPE_BOUNCE,
+               this.projectiledeathtype | HITTYPE_BOUNCE,
                world
        );
 
        Weapon thiswep = WEP_DEVASTATOR;
                world
        );
 
        Weapon thiswep = WEP_DEVASTATOR;
-       if(PS(self.realowner).m_weapon == thiswep)
+       if(PS(this.realowner).m_weapon == thiswep)
        {
        {
-               if(self.realowner.(thiswep.ammo_field) < WEP_CVAR(devastator, ammo))
-               if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(this.realowner.(thiswep.ammo_field) < WEP_CVAR(devastator, ammo))
+               if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                {
-                       self.realowner.cnt = WEP_DEVASTATOR.m_id;
+                       this.realowner.cnt = WEP_DEVASTATOR.m_id;
                        int slot = weaponslot(weaponentity);
                        int slot = weaponslot(weaponentity);
-                       ATTACK_FINISHED(self.realowner, slot) = time;
-                       PS(self.realowner).m_switchweapon = w_getbestweapon(self.realowner);
+                       ATTACK_FINISHED(this.realowner, slot) = time;
+                       PS(this.realowner).m_switchweapon = w_getbestweapon(this.realowner);
                }
        }
                }
        }
-       remove(self);
+       remove(this);
 }
 
 void W_Devastator_RemoteExplode(entity this, .entity weaponentity)
 {
 }
 
 void W_Devastator_RemoteExplode(entity this, .entity weaponentity)
 {
-       if(!IS_DEAD(self.realowner))
-       if(self.realowner.lastrocket)
+       if(!IS_DEAD(this.realowner))
+       if(this.realowner.lastrocket)
        {
        {
-               if((self.spawnshieldtime >= 0)
-                       ? (time >= self.spawnshieldtime) // timer
-                       : (vdist(NearestPointOnBox(self.realowner, self.origin) - self.origin, >, WEP_CVAR(devastator, remote_radius))) // safety device
+               if((this.spawnshieldtime >= 0)
+                       ? (time >= this.spawnshieldtime) // timer
+                       : (vdist(NearestPointOnBox(this.realowner, this.origin) - this.origin, >, WEP_CVAR(devastator, remote_radius))) // safety device
                )
                {
                )
                {
-                       W_Devastator_DoRemoteExplode(self, weaponentity);
+                       W_Devastator_DoRemoteExplode(this, weaponentity);
                }
        }
 }
                }
        }
 }
@@ -256,68 +256,68 @@ void W_Devastator_Think(entity this)
 {
        vector desireddir, olddir, newdir, desiredorigin, goal;
        float velspeed, f;
 {
        vector desireddir, olddir, newdir, desiredorigin, goal;
        float velspeed, f;
-       self.nextthink = time;
-       if(time > self.cnt)
+       this.nextthink = time;
+       if(time > this.cnt)
        {
                other = world;
        {
                other = world;
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
-               W_Devastator_Explode(self);
+               this.projectiledeathtype |= HITTYPE_BOUNCE;
+               W_Devastator_Explode(this);
                return;
        }
 
        // accelerate
                return;
        }
 
        // accelerate
-       makevectors(self.angles.x * '-1 0 0' + self.angles.y * '0 1 0');
-       velspeed = WEP_CVAR(devastator, speed) * W_WeaponSpeedFactor(self.realowner) - (self.velocity * v_forward);
+       makevectors(this.angles.x * '-1 0 0' + this.angles.y * '0 1 0');
+       velspeed = WEP_CVAR(devastator, speed) * W_WeaponSpeedFactor(this.realowner) - (this.velocity * v_forward);
        if(velspeed > 0)
        if(velspeed > 0)
-               self.velocity = self.velocity + v_forward * min(WEP_CVAR(devastator, speedaccel) * W_WeaponSpeedFactor(self.realowner) * frametime, velspeed);
+               this.velocity = this.velocity + v_forward * min(WEP_CVAR(devastator, speedaccel) * W_WeaponSpeedFactor(this.realowner) * frametime, velspeed);
 
        // laser guided, or remote detonation
 
        // laser guided, or remote detonation
-       if(PS(self.realowner).m_weapon == WEP_DEVASTATOR)
+       if(PS(this.realowner).m_weapon == WEP_DEVASTATOR)
        {
        {
-               if(self == self.realowner.lastrocket)
-               if(!self.realowner.rl_release)
-               if(!PHYS_INPUT_BUTTON_ATCK2(self))
+               if(this == this.realowner.lastrocket)
+               if(!this.realowner.rl_release)
+               if(!PHYS_INPUT_BUTTON_ATCK2(this))
                if(WEP_CVAR(devastator, guiderate))
                if(WEP_CVAR(devastator, guiderate))
-               if(time > self.pushltime)
-               if(!IS_DEAD(self.realowner))
+               if(time > this.pushltime)
+               if(!IS_DEAD(this.realowner))
                {
                        f = WEP_CVAR(devastator, guideratedelay);
                        if(f)
                {
                        f = WEP_CVAR(devastator, guideratedelay);
                        if(f)
-                               f = bound(0, (time - self.pushltime) / f, 1);
+                               f = bound(0, (time - this.pushltime) / f, 1);
                        else
                                f = 1;
 
                        else
                                f = 1;
 
-                       velspeed = vlen(self.velocity);
+                       velspeed = vlen(this.velocity);
 
 
-                       makevectors(self.realowner.v_angle);
-                       desireddir = WarpZone_RefSys_TransformVelocity(self.realowner, self, v_forward);
-                       desiredorigin = WarpZone_RefSys_TransformOrigin(self.realowner, self, self.realowner.origin + self.realowner.view_ofs);
-                       olddir = normalize(self.velocity);
+                       makevectors(this.realowner.v_angle);
+                       desireddir = WarpZone_RefSys_TransformVelocity(this.realowner, this, v_forward);
+                       desiredorigin = WarpZone_RefSys_TransformOrigin(this.realowner, this, this.realowner.origin + this.realowner.view_ofs);
+                       olddir = normalize(this.velocity);
 
                        // now it gets tricky... we want to move like some curve to approximate the target direction
                        // but we are limiting the rate at which we can turn!
 
                        // now it gets tricky... we want to move like some curve to approximate the target direction
                        // but we are limiting the rate at which we can turn!
-                       goal = desiredorigin + ((self.origin - desiredorigin) * desireddir + WEP_CVAR(devastator, guidegoal)) * desireddir;
-                       newdir = W_Devastator_SteerTo(olddir, normalize(goal - self.origin), cos(WEP_CVAR(devastator, guiderate) * f * frametime * DEG2RAD));
+                       goal = desiredorigin + ((this.origin - desiredorigin) * desireddir + WEP_CVAR(devastator, guidegoal)) * desireddir;
+                       newdir = W_Devastator_SteerTo(olddir, normalize(goal - this.origin), cos(WEP_CVAR(devastator, guiderate) * f * frametime * DEG2RAD));
 
 
-                       self.velocity = newdir * velspeed;
-                       self.angles = vectoangles(self.velocity);
+                       this.velocity = newdir * velspeed;
+                       this.angles = vectoangles(this.velocity);
 
 
-                       if(!self.count)
+                       if(!this.count)
                        {
                        {
-                               Send_Effect(EFFECT_ROCKET_GUIDE, self.origin, self.velocity, 1);
+                               Send_Effect(EFFECT_ROCKET_GUIDE, this.origin, this.velocity, 1);
                                // TODO add a better sound here
                                // TODO add a better sound here
-                               sound(self.realowner, CH_WEAPON_B, SND_ROCKET_MODE, VOL_BASE, ATTN_NORM);
-                               self.count = 1;
+                               sound(this.realowner, CH_WEAPON_B, SND_ROCKET_MODE, VOL_BASE, ATTN_NORM);
+                               this.count = 1;
                        }
                }
 
                .entity weaponentity = weaponentities[0]; // TODO: unhardcode
                        }
                }
 
                .entity weaponentity = weaponentities[0]; // TODO: unhardcode
-               if(self.rl_detonate_later)
-                       W_Devastator_RemoteExplode(self, weaponentity);
+               if(this.rl_detonate_later)
+                       W_Devastator_RemoteExplode(this, weaponentity);
        }
 
        }
 
-       if(self.csqcprojectile_clientanimate == 0)
-               UpdateCSQCProjectile(self);
+       if(this.csqcprojectile_clientanimate == 0)
+               UpdateCSQCProjectile(this);
 }
 
 void W_Devastator_Touch(entity this)
 }
 
 void W_Devastator_Touch(entity this)
@@ -348,18 +348,18 @@ void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float d
 }
 
 void W_Devastator_Attack(Weapon thiswep, entity actor)
 }
 
 void W_Devastator_Attack(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity missile;
        entity flash;
 
        entity missile;
        entity flash;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR(devastator, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo));
 
 
-       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage));
+       W_SetupShot_ProjectileSize(actor, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage));
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
-       missile = WarpZone_RefSys_SpawnSameRefSys(self);
-       missile.owner = missile.realowner = self;
-       self.lastrocket = missile;
+       missile = WarpZone_RefSys_SpawnSameRefSys(actor);
+       missile.owner = missile.realowner = actor;
+       actor.lastrocket = missile;
        if(WEP_CVAR(devastator, detonatedelay) >= 0)
                missile.spawnshieldtime = time + WEP_CVAR(devastator, detonatedelay);
        else
        if(WEP_CVAR(devastator, detonatedelay) >= 0)
                missile.spawnshieldtime = time + WEP_CVAR(devastator, detonatedelay);
        else
@@ -398,10 +398,10 @@ void W_Devastator_Attack(Weapon thiswep, entity actor)
        setmodel(flash, MDL_DEVASTATOR_MUZZLEFLASH); // precision set below
        SUB_SetFade(flash, time, 0.1);
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
        setmodel(flash, MDL_DEVASTATOR_MUZZLEFLASH); // precision set below
        SUB_SetFade(flash, time, 0.1);
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-       W_AttachToShotorg(self, flash, '5 0 0');
+       W_AttachToShotorg(actor, flash, '5 0 0');
 
        // common properties
 
        // common properties
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 #if 0
 }
 
 #if 0
@@ -409,35 +409,34 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor))
 {
     entity this = actor;
     // aim and decide to fire if appropriate
 {
     entity this = actor;
     // aim and decide to fire if appropriate
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
     {
         // decide whether to detonate rockets
         entity missile, targetlist, targ;
         targetlist = findchainfloat(bot_attack, true);
     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
     {
         // decide whether to detonate rockets
         entity missile, targetlist, targ;
         targetlist = findchainfloat(bot_attack, true);
-        for(missile = world; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == self)
+        for(missile = world; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == actor)
         {
             targ = targetlist;
             while(targ)
             {
                 if(targ != missile.realowner && vlen(targ.origin - missile.origin) < WEP_CVAR(devastator, radius))
                 {
         {
             targ = targetlist;
             while(targ)
             {
                 if(targ != missile.realowner && vlen(targ.origin - missile.origin) < WEP_CVAR(devastator, radius))
                 {
-                    PHYS_INPUT_BUTTON_ATCK2(self) = true;
+                    PHYS_INPUT_BUTTON_ATCK2(actor) = true;
                     break;
                 }
                 targ = targ.chain;
             }
         }
 
                     break;
                 }
                 targ = targ.chain;
             }
         }
 
-        if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
+        if(PHYS_INPUT_BUTTON_ATCK2(actor)) PHYS_INPUT_BUTTON_ATCK(actor) = false;
     }
 }
 #else
 METHOD(Devastator, wr_aim, void(entity thiswep, entity actor))
 {
     }
 }
 #else
 METHOD(Devastator, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     // aim and decide to fire if appropriate
     // aim and decide to fire if appropriate
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
     {
         // decide whether to detonate rockets
     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
     {
         // decide whether to detonate rockets
@@ -452,7 +451,7 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor))
         teamdamage = 0;
         enemydamage = 0;
         targetlist = findchainfloat(bot_attack, true);
         teamdamage = 0;
         enemydamage = 0;
         targetlist = findchainfloat(bot_attack, true);
-        FOREACH_ENTITY_ENT(realowner, self,
+        FOREACH_ENTITY_ENT(realowner, actor,
         {
             if(it.classname != "rocket") continue;
 
         {
             if(it.classname != "rocket") continue;
 
@@ -462,23 +461,23 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor))
                 d = vlen(targ.origin + (targ.mins + targ.maxs) * 0.5 - it.origin);
                 d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
                 // count potential damage according to type of target
                 d = vlen(targ.origin + (targ.mins + targ.maxs) * 0.5 - it.origin);
                 d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
                 // count potential damage according to type of target
-                if(targ == self)
+                if(targ == actor)
                     selfdamage = selfdamage + d;
                     selfdamage = selfdamage + d;
-                else if(targ.team == self.team && teamplay)
+                else if(targ.team == actor.team && teamplay)
                     teamdamage = teamdamage + d;
                     teamdamage = teamdamage + d;
-                else if(bot_shouldattack(self, targ))
+                else if(bot_shouldattack(actor, targ))
                     enemydamage = enemydamage + d;
                 targ = targ.chain;
             }
         });
         float desirabledamage;
         desirabledamage = enemydamage;
                     enemydamage = enemydamage + d;
                 targ = targ.chain;
             }
         });
         float desirabledamage;
         desirabledamage = enemydamage;
-        if(time > self.invincible_finished && time > self.spawnshieldtime)
+        if(time > actor.invincible_finished && time > actor.spawnshieldtime)
             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
-        if(teamplay && self.team)
+        if(teamplay && actor.team)
             desirabledamage = desirabledamage - teamdamage;
 
             desirabledamage = desirabledamage - teamdamage;
 
-        FOREACH_ENTITY_ENT(realowner, self,
+        FOREACH_ENTITY_ENT(realowner, actor,
         {
             if(it.classname != "rocket") continue;
 
         {
             if(it.classname != "rocket") continue;
 
@@ -492,32 +491,32 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor))
                     if(
                         (v_forward * normalize(it.origin - targ.origin)< 0.1)
                         && desirabledamage > 0.1*coredamage
                     if(
                         (v_forward * normalize(it.origin - targ.origin)< 0.1)
                         && desirabledamage > 0.1*coredamage
-                    ) PHYS_INPUT_BUTTON_ATCK2(self) = true;
+                    ) PHYS_INPUT_BUTTON_ATCK2(actor) = true;
                     targ = targ.chain;
                 }
             }
             else
             {
                     targ = targ.chain;
                 }
             }
             else
             {
-                float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000);
+                float distance; distance= bound(300,vlen(actor.origin-actor.enemy.origin),30000);
                 //As the distance gets larger, a correct detonation gets near imposible
                 //Bots are assumed to use the rocket spawnfunc_light to see if the rocket gets near a player
                 //As the distance gets larger, a correct detonation gets near imposible
                 //Bots are assumed to use the rocket spawnfunc_light to see if the rocket gets near a player
-                if(v_forward * normalize(it.origin - self.enemy.origin)< 0.1)
-                    if(IS_PLAYER(self.enemy))
+                if(v_forward * normalize(it.origin - actor.enemy.origin)< 0.1)
+                    if(IS_PLAYER(actor.enemy))
                         if(desirabledamage >= 0.1*coredamage)
                             if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
                         if(desirabledamage >= 0.1*coredamage)
                             if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
-                                PHYS_INPUT_BUTTON_ATCK2(self) = true;
+                                PHYS_INPUT_BUTTON_ATCK2(actor) = true;
             // dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
             }
         });
         // if we would be doing at X percent of the core damage, detonate it
         // but don't fire a new shot at the same time!
         if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
             // dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
             }
         });
         // if we would be doing at X percent of the core damage, detonate it
         // but don't fire a new shot at the same time!
         if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
-            PHYS_INPUT_BUTTON_ATCK2(self) = true;
-        if((skill > 6.5) && (selfdamage > self.health))
-            PHYS_INPUT_BUTTON_ATCK2(self) = false;
-        //if(PHYS_INPUT_BUTTON_ATCK2(self) == true)
+            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
+        if((skill > 6.5) && (selfdamage > actor.health))
+            PHYS_INPUT_BUTTON_ATCK2(actor) = false;
+        //if(PHYS_INPUT_BUTTON_ATCK2(actor) == true)
         //     dprint(ftos(desirabledamage),"\n");
         //     dprint(ftos(desirabledamage),"\n");
-        if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
+        if(PHYS_INPUT_BUTTON_ATCK2(actor)) PHYS_INPUT_BUTTON_ATCK(actor) = false;
     }
 }
 #endif
     }
 }
 #endif
@@ -559,8 +558,7 @@ METHOD(Devastator, wr_think, void(entity thiswep, entity actor, .entity weaponen
 }
 METHOD(Devastator, wr_setup, void(entity thiswep, entity actor))
 {
 }
 METHOD(Devastator, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.rl_release = 1;
+    actor.rl_release = 1;
 }
 METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor))
 {
 }
 METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor))
 {
@@ -604,9 +602,8 @@ METHOD(Devastator, wr_checkammo2, bool(entity thiswep, entity actor))
 }
 METHOD(Devastator, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Devastator, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
-    self.rl_release = 0;
+    actor.lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
+    actor.rl_release = 0;
 }
 METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
 }
 METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
@@ -629,12 +626,11 @@ METHOD(Devastator, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
+        sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
 }
 
 #endif
 }
 
 #endif
index 19e3ff8a82f59e1062237228cf122fc84961d636..f8e7d8427f88c93ed4707c2ed45329eed7088416 100644 (file)
@@ -124,13 +124,13 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own)
 
 void W_Electro_ExplodeCombo(entity this)
 {
 
 void W_Electro_ExplodeCombo(entity this)
 {
-       W_Electro_TriggerCombo(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
+       W_Electro_TriggerCombo(this.origin, WEP_CVAR(electro, combo_comboradius), this.realowner);
 
 
-       self.event_damage = func_null;
+       this.event_damage = func_null;
 
        RadiusDamage(
 
        RadiusDamage(
-               self,
-               self.realowner,
+               this,
+               this.realowner,
                WEP_CVAR(electro, combo_damage),
                WEP_CVAR(electro, combo_edgedamage),
                WEP_CVAR(electro, combo_radius),
                WEP_CVAR(electro, combo_damage),
                WEP_CVAR(electro, combo_edgedamage),
                WEP_CVAR(electro, combo_radius),
@@ -141,54 +141,54 @@ void W_Electro_ExplodeCombo(entity this)
                world
        );
 
                world
        );
 
-       remove(self);
+       remove(this);
 }
 
 void W_Electro_Explode(entity this)
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
 }
 
 void W_Electro_Explode(entity this)
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
-                       if(DIFF_TEAM(self.realowner, other))
+                       if(DIFF_TEAM(this.realowner, other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
-                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
+                                               Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
 
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
 
-       if(self.movetype == MOVETYPE_BOUNCE)
+       if(this.movetype == MOVETYPE_BOUNCE)
        {
                RadiusDamage(
        {
                RadiusDamage(
-                       self,
-                       self.realowner,
+                       this,
+                       this.realowner,
                        WEP_CVAR_SEC(electro, damage),
                        WEP_CVAR_SEC(electro, edgedamage),
                        WEP_CVAR_SEC(electro, radius),
                        world,
                        world,
                        WEP_CVAR_SEC(electro, force),
                        WEP_CVAR_SEC(electro, damage),
                        WEP_CVAR_SEC(electro, edgedamage),
                        WEP_CVAR_SEC(electro, radius),
                        world,
                        world,
                        WEP_CVAR_SEC(electro, force),
-                       self.projectiledeathtype,
+                       this.projectiledeathtype,
                        other
                );
        }
        else
        {
                        other
                );
        }
        else
        {
-               W_Electro_TriggerCombo(self.origin, WEP_CVAR_PRI(electro, comboradius), self.realowner);
+               W_Electro_TriggerCombo(this.origin, WEP_CVAR_PRI(electro, comboradius), this.realowner);
                RadiusDamage(
                RadiusDamage(
-                       self,
-                       self.realowner,
+                       this,
+                       this.realowner,
                        WEP_CVAR_PRI(electro, damage),
                        WEP_CVAR_PRI(electro, edgedamage),
                        WEP_CVAR_PRI(electro, radius),
                        world,
                        world,
                        WEP_CVAR_PRI(electro, force),
                        WEP_CVAR_PRI(electro, damage),
                        WEP_CVAR_PRI(electro, edgedamage),
                        WEP_CVAR_PRI(electro, radius),
                        world,
                        world,
                        WEP_CVAR_PRI(electro, force),
-                       self.projectiledeathtype,
+                       this.projectiledeathtype,
                        other
                );
        }
 
                        other
                );
        }
 
-       remove(self);
+       remove(this);
 }
 
 void W_Electro_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_Electro_Explode_use(entity this, entity actor, entity trigger)
@@ -204,7 +204,7 @@ void W_Electro_TouchExplode(entity this)
 
 void W_Electro_Bolt_Think(entity this)
 {
 
 void W_Electro_Bolt_Think(entity this)
 {
-       if(time >= self.ltime)
+       if(time >= this.ltime)
        {
                this.use(this, NULL, NULL);
                return;
        {
                this.use(this, NULL, NULL);
                return;
@@ -213,7 +213,7 @@ void W_Electro_Bolt_Think(entity this)
        if(WEP_CVAR_PRI(electro, midaircombo_radius))
        {
                float found = 0;
        if(WEP_CVAR_PRI(electro, midaircombo_radius))
        {
                float found = 0;
-               entity e = WarpZone_FindRadius(self.origin, WEP_CVAR_PRI(electro, midaircombo_radius), true);
+               entity e = WarpZone_FindRadius(this.origin, WEP_CVAR_PRI(electro, midaircombo_radius), true);
 
                // loop through nearby orbs and trigger them
                while(e)
 
                // loop through nearby orbs and trigger them
                while(e)
@@ -221,7 +221,7 @@ void W_Electro_Bolt_Think(entity this)
                        if(e.classname == "electro_orb")
                        {
                                // change owner to whoever caused the combo explosion
                        if(e.classname == "electro_orb")
                        {
                                // change owner to whoever caused the combo explosion
-                               e.realowner = self.realowner;
+                               e.realowner = this.realowner;
                                e.takedamage = DAMAGE_NO;
                                e.classname = "electro_orb_chain";
 
                                e.takedamage = DAMAGE_NO;
                                e.classname = "electro_orb_chain";
 
@@ -249,19 +249,19 @@ void W_Electro_Bolt_Think(entity this)
                if(found && WEP_CVAR_PRI(electro, midaircombo_explode))
                        { this.use(this, NULL, NULL); }
                else
                if(found && WEP_CVAR_PRI(electro, midaircombo_explode))
                        { this.use(this, NULL, NULL); }
                else
-                       { self.nextthink = min(time + WEP_CVAR_PRI(electro, midaircombo_interval), self.ltime); }
+                       { this.nextthink = min(time + WEP_CVAR_PRI(electro, midaircombo_interval), this.ltime); }
        }
        }
-       else { self.nextthink = self.ltime; }
+       else { this.nextthink = this.ltime; }
 }
 
 void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
 }
 
 void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity proj;
 
        entity proj;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(electro, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(electro, ammo));
 
        W_SetupShot_ProjectileSize(
 
        W_SetupShot_ProjectileSize(
-               self,
+               actor,
                '0 0 -3',
                '0 0 -3',
                false,
                '0 0 -3',
                '0 0 -3',
                false,
@@ -274,7 +274,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        proj = new(electro_bolt);
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        proj = new(electro_bolt);
-       proj.owner = proj.realowner = self;
+       proj.owner = proj.realowner = actor;
        proj.bot_dodge = true;
        proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
        proj.use = W_Electro_Explode_use;
        proj.bot_dodge = true;
        proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
        proj.use = W_Electro_Explode_use;
@@ -295,19 +295,19 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
 
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
 
 
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, proj);
+       MUTATOR_CALLHOOK(EditProjectile, actor, proj);
 }
 
 void W_Electro_Orb_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
        if(other.takedamage == DAMAGE_AIM)
 }
 
 void W_Electro_Orb_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
        if(other.takedamage == DAMAGE_AIM)
-               { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(self); } }
+               { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(this); } }
        else
        {
        else
        {
-               //UpdateCSQCProjectile(self);
-               spamsound(self, CH_SHOTS, SND(ELECTRO_BOUNCE), VOL_BASE, ATTEN_NORM);
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
+               //UpdateCSQCProjectile(this);
+               spamsound(this, CH_SHOTS, SND(ELECTRO_BOUNCE), VOL_BASE, ATTEN_NORM);
+               this.projectiledeathtype |= HITTYPE_BOUNCE;
        }
 }
 
        }
 }
 
@@ -354,11 +354,11 @@ void W_Electro_Orb_Damage(entity this, entity inflictor, entity attacker, float
 }
 
 void W_Electro_Attack_Orb(Weapon thiswep, entity actor)
 }
 
 void W_Electro_Attack_Orb(Weapon thiswep, entity actor)
-{entity this = actor;
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(electro, ammo));
+{
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(electro, ammo));
 
        W_SetupShot_ProjectileSize(
 
        W_SetupShot_ProjectileSize(
-               self,
+               actor,
                '0 0 -4',
                '0 0 -4',
                false,
                '0 0 -4',
                '0 0 -4',
                false,
@@ -373,7 +373,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor)
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        entity proj = new(electro_orb);
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        entity proj = new(electro_orb);
-       proj.owner = proj.realowner = self;
+       proj.owner = proj.realowner = actor;
        proj.use = W_Electro_Explode_use;
        setthink(proj, adaptor_think2use_hittype_splash);
        proj.bot_dodge = true;
        proj.use = W_Electro_Explode_use;
        setthink(proj, adaptor_think2use_hittype_splash);
        proj.bot_dodge = true;
@@ -410,17 +410,17 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor)
 
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
 
 
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
 
-       MUTATOR_CALLHOOK(EditProjectile, self, proj);
+       MUTATOR_CALLHOOK(EditProjectile, actor, proj);
 }
 
 void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 }
 
 void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, int fire)
-{entity this = actor;
-       if(self.electro_count > 1)
-       if(PHYS_INPUT_BUTTON_ATCK2(self))
+{
+       if(actor.electro_count > 1)
+       if(PHYS_INPUT_BUTTON_ATCK2(actor))
        if(weapon_prepareattack(thiswep, actor, weaponentity, true, -1))
        {
                W_Electro_Attack_Orb(WEP_ELECTRO, actor);
        if(weapon_prepareattack(thiswep, actor, weaponentity, true, -1))
        {
                W_Electro_Attack_Orb(WEP_ELECTRO, actor);
-               self.electro_count -= 1;
+               actor.electro_count -= 1;
                weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
                return;
        }
                weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
                return;
        }
@@ -432,30 +432,29 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, i
 
 METHOD(Electro, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(Electro, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    PHYS_INPUT_BUTTON_ATCK(self) = PHYS_INPUT_BUTTON_ATCK2(self) = false;
-    if(vdist(self.origin - self.enemy.origin, >, 1000)) { self.bot_secondary_electromooth = 0; }
-    if(self.bot_secondary_electromooth == 0)
+    PHYS_INPUT_BUTTON_ATCK(actor) = PHYS_INPUT_BUTTON_ATCK2(actor) = false;
+    if(vdist(actor.origin - actor.enemy.origin, >, 1000)) { actor.bot_secondary_electromooth = 0; }
+    if(actor.bot_secondary_electromooth == 0)
     {
         float shoot;
 
         if(WEP_CVAR_PRI(electro, speed))
     {
         float shoot;
 
         if(WEP_CVAR_PRI(electro, speed))
-            shoot = bot_aim(self, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
+            shoot = bot_aim(actor, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
         else
         else
-            shoot = bot_aim(self, 1000000, 0, 0.001, false);
+            shoot = bot_aim(actor, 1000000, 0, 0.001, false);
 
         if(shoot)
         {
 
         if(shoot)
         {
-            PHYS_INPUT_BUTTON_ATCK(self) = true;
-            if(random() < 0.01) self.bot_secondary_electromooth = 1;
+            PHYS_INPUT_BUTTON_ATCK(actor) = true;
+            if(random() < 0.01) actor.bot_secondary_electromooth = 1;
         }
     }
     else
     {
         }
     }
     else
     {
-        if(bot_aim(self, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
+        if(bot_aim(actor, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
         {
         {
-            PHYS_INPUT_BUTTON_ATCK2(self) = true;
-            if(random() < 0.03) self.bot_secondary_electromooth = 0;
+            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
+            if(random() < 0.03) actor.bot_secondary_electromooth = 0;
         }
     }
 }
         }
     }
 }
@@ -519,8 +518,7 @@ METHOD(Electro, wr_checkammo2, bool(entity thiswep, entity actor))
 }
 METHOD(Electro, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Electro, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.electro_secondarytime = time;
+    actor.electro_secondarytime = time;
 }
 METHOD(Electro, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
 }
 METHOD(Electro, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
@@ -553,14 +551,13 @@ METHOD(Electro, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 6;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1);
         if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 6;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1);
         if(!w_issilent)
-            sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
+            sound(actor, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
     }
     else
     {
     }
     else
     {
@@ -569,13 +566,13 @@ METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
             // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
             pointparticles(EFFECT_ELECTRO_COMBO, org2, '0 0 0', 1);
             if(!w_issilent)
             // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
             pointparticles(EFFECT_ELECTRO_COMBO, org2, '0 0 0', 1);
             if(!w_issilent)
-                sound(self, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM);
+                sound(actor, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM);
         }
         else
         {
             pointparticles(EFFECT_ELECTRO_IMPACT, org2, '0 0 0', 1);
             if(!w_issilent)
         }
         else
         {
             pointparticles(EFFECT_ELECTRO_IMPACT, org2, '0 0 0', 1);
             if(!w_issilent)
-                sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
+                sound(actor, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
         }
     }
 }
         }
     }
 }
index d6768f9eb7bad42347f8ba1199e2163d16f28833..5c21c8ba159a1095aff836c233e41aa9afe127ad 100644 (file)
@@ -70,46 +70,46 @@ void W_Fireball_Explode(entity this)
        vector dir;
        float d;
 
        vector dir;
        float d;
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
        // 1. dist damage
 
        // 1. dist damage
-       d = (self.realowner.health + self.realowner.armorvalue);
-       RadiusDamage(self, self.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), world, world, WEP_CVAR_PRI(fireball, force), self.projectiledeathtype, other);
-       if(self.realowner.health + self.realowner.armorvalue >= d)
-       if(!self.cnt)
+       d = (this.realowner.health + this.realowner.armorvalue);
+       RadiusDamage(this, this.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), world, world, WEP_CVAR_PRI(fireball, force), this.projectiledeathtype, other);
+       if(this.realowner.health + this.realowner.armorvalue >= d)
+       if(!this.cnt)
        {
        {
-               modeleffect_spawn("models/sphere/sphere.md3", 0, 0, self.origin, '0 0 0', '0 0 0', '0 0 0', 0, WEP_CVAR_PRI(fireball, bfgradius), 0.2, 0.05, 0.25);
+               modeleffect_spawn("models/sphere/sphere.md3", 0, 0, this.origin, '0 0 0', '0 0 0', '0 0 0', 0, WEP_CVAR_PRI(fireball, bfgradius), 0.2, 0.05, 0.25);
 
                // 2. bfg effect
                // NOTE: this cannot be made warpzone aware by design. So, better intentionally ignore warpzones here.
 
                // 2. bfg effect
                // NOTE: this cannot be made warpzone aware by design. So, better intentionally ignore warpzones here.
-               for(e = findradius(self.origin, WEP_CVAR_PRI(fireball, bfgradius)); e; e = e.chain)
-               if(e != self.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !self.realowner || DIFF_TEAM(e, self))
+               for(e = findradius(this.origin, WEP_CVAR_PRI(fireball, bfgradius)); e; e = e.chain)
+               if(e != this.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !this.realowner || DIFF_TEAM(e, this))
                {
                        // can we see fireball?
                {
                        // can we see fireball?
-                       traceline(e.origin + e.view_ofs, self.origin, MOVE_NORMAL, e);
+                       traceline(e.origin + e.view_ofs, this.origin, MOVE_NORMAL, e);
                        if(/* trace_startsolid || */ trace_fraction != 1) // startsolid should be never happening anyway
                                continue;
                        // can we see player who shot fireball?
                        if(/* trace_startsolid || */ trace_fraction != 1) // startsolid should be never happening anyway
                                continue;
                        // can we see player who shot fireball?
-                       traceline(e.origin + e.view_ofs, self.realowner.origin + self.realowner.view_ofs, MOVE_NORMAL, e);
-                       if(trace_ent != self.realowner)
+                       traceline(e.origin + e.view_ofs, this.realowner.origin + this.realowner.view_ofs, MOVE_NORMAL, e);
+                       if(trace_ent != this.realowner)
                        if(/* trace_startsolid || */ trace_fraction != 1)
                                continue;
                        if(/* trace_startsolid || */ trace_fraction != 1)
                                continue;
-                       dist = vlen(self.origin - e.origin - e.view_ofs);
+                       dist = vlen(this.origin - e.origin - e.view_ofs);
                        points = (1 - sqrt(dist / WEP_CVAR_PRI(fireball, bfgradius)));
                        if(points <= 0)
                                continue;
                        points = (1 - sqrt(dist / WEP_CVAR_PRI(fireball, bfgradius)));
                        if(points <= 0)
                                continue;
-                       dir = normalize(e.origin + e.view_ofs - self.origin);
+                       dir = normalize(e.origin + e.view_ofs - this.origin);
 
 
-                       if(accuracy_isgooddamage(self.realowner, e))
-                               accuracy_add(self.realowner, WEP_FIREBALL.m_id, 0, WEP_CVAR_PRI(fireball, bfgdamage) * points);
+                       if(accuracy_isgooddamage(this.realowner, e))
+                               accuracy_add(this.realowner, WEP_FIREBALL.m_id, 0, WEP_CVAR_PRI(fireball, bfgdamage) * points);
 
 
-                       Damage(e, self, self.realowner, WEP_CVAR_PRI(fireball, bfgdamage) * points, self.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, WEP_CVAR_PRI(fireball, bfgforce) * dir);
+                       Damage(e, this, this.realowner, WEP_CVAR_PRI(fireball, bfgdamage) * points, this.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, WEP_CVAR_PRI(fireball, bfgforce) * dir);
                        Send_Effect(EFFECT_FIREBALL_BFGDAMAGE, e.origin, -1 * dir, 1);
                }
        }
 
                        Send_Effect(EFFECT_FIREBALL_BFGDAMAGE, e.origin, -1 * dir, 1);
                }
        }
 
-       remove(self);
+       remove(this);
 }
 
 void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
@@ -133,14 +133,14 @@ void W_Fireball_LaserPlay(entity this, float dt, float dist, float damage, float
                return;
 
        RandomSelection_Init();
                return;
 
        RandomSelection_Init();
-       for(e = WarpZone_FindRadius(self.origin, dist, true); e; e = e.chain)
-       if(e != self.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !self.realowner || DIFF_TEAM(e, self))
+       for(e = WarpZone_FindRadius(this.origin, dist, true); e; e = e.chain)
+       if(e != this.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !this.realowner || DIFF_TEAM(e, this))
        {
                p = e.origin;
                p.x += e.mins.x + random() * (e.maxs.x - e.mins.x);
                p.y += e.mins.y + random() * (e.maxs.y - e.mins.y);
                p.z += e.mins.z + random() * (e.maxs.z - e.mins.z);
        {
                p = e.origin;
                p.x += e.mins.x + random() * (e.maxs.x - e.mins.x);
                p.y += e.mins.y + random() * (e.maxs.y - e.mins.y);
                p.z += e.mins.z + random() * (e.maxs.z - e.mins.z);
-               d = vlen(WarpZone_UnTransformOrigin(e, self.origin) - p);
+               d = vlen(WarpZone_UnTransformOrigin(e, this.origin) - p);
                if(d < dist)
                {
                        e.fireball_impactvec = p;
                if(d < dist)
                {
                        e.fireball_impactvec = p;
@@ -149,27 +149,27 @@ void W_Fireball_LaserPlay(entity this, float dt, float dist, float damage, float
        }
        if(RandomSelection_chosen_ent)
        {
        }
        if(RandomSelection_chosen_ent)
        {
-               d = vlen(WarpZone_UnTransformOrigin(RandomSelection_chosen_ent, self.origin) - RandomSelection_chosen_ent.fireball_impactvec);
+               d = vlen(WarpZone_UnTransformOrigin(RandomSelection_chosen_ent, this.origin) - RandomSelection_chosen_ent.fireball_impactvec);
                d = damage + (edgedamage - damage) * (d / dist);
                d = damage + (edgedamage - damage) * (d / dist);
-               Fire_AddDamage(RandomSelection_chosen_ent, self.realowner, d * burntime, burntime, self.projectiledeathtype | HITTYPE_BOUNCE);
-               //trailparticles(self, particleeffectnum(EFFECT_FIREBALL_LASER), self.origin, RandomSelection_chosen_ent.fireball_impactvec);
-               Send_Effect(EFFECT_FIREBALL_LASER, self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1);
+               Fire_AddDamage(RandomSelection_chosen_ent, this.realowner, d * burntime, burntime, this.projectiledeathtype | HITTYPE_BOUNCE);
+               //trailparticles(this, particleeffectnum(EFFECT_FIREBALL_LASER), this.origin, RandomSelection_chosen_ent.fireball_impactvec);
+               Send_Effect(EFFECT_FIREBALL_LASER, this.origin, RandomSelection_chosen_ent.fireball_impactvec - this.origin, 1);
        }
 }
 
 void W_Fireball_Think(entity this)
 {
        }
 }
 
 void W_Fireball_Think(entity this)
 {
-       if(time > self.pushltime)
+       if(time > this.pushltime)
        {
        {
-               self.cnt = 1;
-               self.projectiledeathtype |= HITTYPE_SPLASH;
+               this.cnt = 1;
+               this.projectiledeathtype |= HITTYPE_SPLASH;
                W_Fireball_Explode(this);
                return;
        }
 
                W_Fireball_Explode(this);
                return;
        }
 
-       W_Fireball_LaserPlay(self, 0.1, WEP_CVAR_PRI(fireball, laserradius), WEP_CVAR_PRI(fireball, laserdamage), WEP_CVAR_PRI(fireball, laseredgedamage), WEP_CVAR_PRI(fireball, laserburntime));
+       W_Fireball_LaserPlay(this, 0.1, WEP_CVAR_PRI(fireball, laserradius), WEP_CVAR_PRI(fireball, laserdamage), WEP_CVAR_PRI(fireball, laseredgedamage), WEP_CVAR_PRI(fireball, laserburntime));
 
 
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 }
 
 void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 }
 
 void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@ -189,15 +189,15 @@ void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float dam
 }
 
 void W_Fireball_Attack1(entity actor)
 }
 
 void W_Fireball_Attack1(entity actor)
-{entity this = actor;
+{
        entity proj;
 
        entity proj;
 
-       W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, SND_FIREBALL_FIRE2, CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
+       W_SetupShot_ProjectileSize(actor, '-16 -16 -16', '16 16 16', false, 2, SND_FIREBALL_FIRE2, CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
 
        Send_Effect(EFFECT_FIREBALL_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        proj = new(plasma_prim);
 
        Send_Effect(EFFECT_FIREBALL_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        proj = new(plasma_prim);
-       proj.owner = proj.realowner = self;
+       proj.owner = proj.realowner = actor;
        proj.bot_dodge = true;
        proj.bot_dodgerating = WEP_CVAR_PRI(fireball, damage);
        proj.pushltime = time + WEP_CVAR_PRI(fireball, lifetime);
        proj.bot_dodge = true;
        proj.bot_dodgerating = WEP_CVAR_PRI(fireball, damage);
        proj.pushltime = time + WEP_CVAR_PRI(fireball, lifetime);
@@ -205,7 +205,7 @@ void W_Fireball_Attack1(entity actor)
        setthink(proj, W_Fireball_Think);
        proj.nextthink = time;
        proj.health = WEP_CVAR_PRI(fireball, health);
        setthink(proj, W_Fireball_Think);
        proj.nextthink = time;
        proj.health = WEP_CVAR_PRI(fireball, health);
-       proj.team = self.team;
+       proj.team = actor.team;
        proj.event_damage = W_Fireball_Damage;
        proj.takedamage = DAMAGE_YES;
        proj.damageforcescale = WEP_CVAR_PRI(fireball, damageforcescale);
        proj.event_damage = W_Fireball_Damage;
        proj.takedamage = DAMAGE_YES;
        proj.damageforcescale = WEP_CVAR_PRI(fireball, damageforcescale);
@@ -223,7 +223,7 @@ void W_Fireball_Attack1(entity actor)
 
        CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
 
 
        CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, proj);
+       MUTATOR_CALLHOOK(EditProjectile, actor, proj);
 }
 
 void W_Fireball_AttackEffect(entity actor, float i, vector f_diff)
 }
 
 void W_Fireball_AttackEffect(entity actor, float i, vector f_diff)
@@ -266,49 +266,49 @@ void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, .entity weaponentit
 
 void W_Fireball_Firemine_Think(entity this)
 {
 
 void W_Fireball_Firemine_Think(entity this)
 {
-       if(time > self.pushltime)
+       if(time > this.pushltime)
        {
        {
-               remove(self);
+               remove(this);
                return;
        }
 
        // make it "hot" once it leaves its owner
                return;
        }
 
        // make it "hot" once it leaves its owner
-       if(self.owner)
+       if(this.owner)
        {
        {
-               if(vdist(self.origin - self.owner.origin - self.owner.view_ofs, >, WEP_CVAR_SEC(fireball, laserradius)))
+               if(vdist(this.origin - this.owner.origin - this.owner.view_ofs, >, WEP_CVAR_SEC(fireball, laserradius)))
                {
                {
-                       self.cnt += 1;
-                       if(self.cnt == 3)
-                               self.owner = world;
+                       this.cnt += 1;
+                       if(this.cnt == 3)
+                               this.owner = world;
                }
                else
                }
                else
-                       self.cnt = 0;
+                       this.cnt = 0;
        }
 
        }
 
-       W_Fireball_LaserPlay(self, 0.1, WEP_CVAR_SEC(fireball, laserradius), WEP_CVAR_SEC(fireball, laserdamage), WEP_CVAR_SEC(fireball, laseredgedamage), WEP_CVAR_SEC(fireball, laserburntime));
+       W_Fireball_LaserPlay(this, 0.1, WEP_CVAR_SEC(fireball, laserradius), WEP_CVAR_SEC(fireball, laserdamage), WEP_CVAR_SEC(fireball, laseredgedamage), WEP_CVAR_SEC(fireball, laserburntime));
 
 
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 }
 
 void W_Fireball_Firemine_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
        if(other.takedamage == DAMAGE_AIM)
 }
 
 void W_Fireball_Firemine_Touch(entity this)
 {
        PROJECTILE_TOUCH(this);
        if(other.takedamage == DAMAGE_AIM)
-       if(Fire_AddDamage(other, self.realowner, WEP_CVAR_SEC(fireball, damage), WEP_CVAR_SEC(fireball, damagetime), self.projectiledeathtype) >= 0)
+       if(Fire_AddDamage(other, this.realowner, WEP_CVAR_SEC(fireball, damage), WEP_CVAR_SEC(fireball, damagetime), this.projectiledeathtype) >= 0)
        {
        {
-               remove(self);
+               remove(this);
                return;
        }
                return;
        }
-       self.projectiledeathtype |= HITTYPE_BOUNCE;
+       this.projectiledeathtype |= HITTYPE_BOUNCE;
 }
 
 void W_Fireball_Attack2(entity actor)
 }
 
 void W_Fireball_Attack2(entity actor)
-{entity this = actor;
+{
        entity proj;
        vector f_diff;
        float c;
 
        entity proj;
        vector f_diff;
        float c;
 
-       c = self.bulletcounter % 4;
+       c = actor.bulletcounter % 4;
        switch(c)
        {
                case 0:
        switch(c)
        {
                case 0:
@@ -325,14 +325,14 @@ void W_Fireball_Attack2(entity actor)
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 2, SND_FIREBALL_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
-       traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, self);
+       W_SetupShot_ProjectileSize(actor, '-4 -4 -4', '4 4 4', false, 2, SND_FIREBALL_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(fireball, damage));
+       traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, actor);
        w_shotorg = trace_endpos;
 
        Send_Effect(EFFECT_FIREBALL_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        proj = new(grenade);
        w_shotorg = trace_endpos;
 
        Send_Effect(EFFECT_FIREBALL_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        proj = new(grenade);
-       proj.owner = proj.realowner = self;
+       proj.owner = proj.realowner = actor;
        proj.bot_dodge = true;
        proj.bot_dodgerating = WEP_CVAR_SEC(fireball, damage);
        proj.movetype = MOVETYPE_BOUNCE;
        proj.bot_dodge = true;
        proj.bot_dodgerating = WEP_CVAR_SEC(fireball, damage);
        proj.movetype = MOVETYPE_BOUNCE;
@@ -353,28 +353,27 @@ void W_Fireball_Attack2(entity actor)
 
        CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
 
 
        CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, proj);
+       MUTATOR_CALLHOOK(EditProjectile, actor, proj);
 }
 
 METHOD(Fireball, wr_aim, void(entity thiswep, entity actor))
 {
 }
 
 METHOD(Fireball, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    PHYS_INPUT_BUTTON_ATCK(self) = false;
-    PHYS_INPUT_BUTTON_ATCK2(self) = false;
-    if(self.bot_primary_fireballmooth == 0)
+    PHYS_INPUT_BUTTON_ATCK(actor) = false;
+    PHYS_INPUT_BUTTON_ATCK2(actor) = false;
+    if(actor.bot_primary_fireballmooth == 0)
     {
     {
-        if(bot_aim(self, WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), false))
+        if(bot_aim(actor, WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), false))
         {
         {
-            PHYS_INPUT_BUTTON_ATCK(self) = true;
-            if(random() < 0.02) self.bot_primary_fireballmooth = 0;
+            PHYS_INPUT_BUTTON_ATCK(actor) = true;
+            if(random() < 0.02) actor.bot_primary_fireballmooth = 0;
         }
     }
     else
     {
         }
     }
     else
     {
-        if(bot_aim(self, WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), true))
+        if(bot_aim(actor, WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), true))
         {
         {
-            PHYS_INPUT_BUTTON_ATCK2(self) = true;
-            if(random() < 0.01) self.bot_primary_fireballmooth = 1;
+            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
+            if(random() < 0.01) actor.bot_primary_fireballmooth = 1;
         }
     }
 }
         }
     }
 }
@@ -400,8 +399,7 @@ METHOD(Fireball, wr_think, void(entity thiswep, entity actor, .entity weaponenti
 }
 METHOD(Fireball, wr_setup, void(entity thiswep, entity actor))
 {
 }
 METHOD(Fireball, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.ammo_field = ammo_none;
+    actor.ammo_field = ammo_none;
 }
 METHOD(Fireball, wr_checkammo1, bool(entity thiswep, entity actor))
 {
 }
 METHOD(Fireball, wr_checkammo1, bool(entity thiswep, entity actor))
 {
@@ -413,8 +411,7 @@ METHOD(Fireball, wr_checkammo2, bool(entity thiswep, entity actor))
 }
 METHOD(Fireball, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Fireball, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.fireball_primarytime = time;
+    actor.fireball_primarytime = time;
 }
 METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep))
 {
 }
 METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep))
 {
@@ -436,7 +433,6 @@ METHOD(Fireball, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
     vector org2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
@@ -447,7 +443,7 @@ METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
         org2 = w_org + w_backoff * 16;
         pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1);
         if(!w_issilent)
         org2 = w_org + w_backoff * 16;
         pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1);
         if(!w_issilent)
-            sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
+            sound(actor, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
     }
 }
 
     }
 }
 
index a81479869e6cda8cbc0df0ba65f690ef55a5d771..7914c6b798c34c6c9a6e7f90cd2118fc2763a012 100644 (file)
@@ -65,10 +65,10 @@ spawnfunc(weapon_hagar) { weapon_defaultspawnfunc(this, WEP_HAGAR); }
 
 void W_Hagar_Explode(entity this)
 {
 
 void W_Hagar_Explode(entity this)
 {
-       self.event_damage = func_null;
-       RadiusDamage(self, self.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), world, world, WEP_CVAR_PRI(hagar, force), self.projectiledeathtype, other);
+       this.event_damage = func_null;
+       RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), world, world, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_Hagar_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_Hagar_Explode_use(entity this, entity actor, entity trigger)
@@ -78,10 +78,10 @@ void W_Hagar_Explode_use(entity this, entity actor, entity trigger)
 
 void W_Hagar_Explode2(entity this)
 {
 
 void W_Hagar_Explode2(entity this)
 {
-       self.event_damage = func_null;
-       RadiusDamage(self, self.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), world, world, WEP_CVAR_SEC(hagar, force), self.projectiledeathtype, other);
+       this.event_damage = func_null;
+       RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), world, world, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_Hagar_Explode2_use(entity this, entity actor, entity trigger)
 }
 
 void W_Hagar_Explode2_use(entity this, entity actor, entity trigger)
@@ -123,29 +123,29 @@ void W_Hagar_Touch2(entity this)
 {
        PROJECTILE_TOUCH(this);
 
 {
        PROJECTILE_TOUCH(this);
 
-       if(self.cnt > 0 || other.takedamage == DAMAGE_AIM) {
+       if(this.cnt > 0 || other.takedamage == DAMAGE_AIM) {
                this.use(this, NULL, NULL);
        } else {
                this.use(this, NULL, NULL);
        } else {
-               self.cnt++;
-               Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1);
-               self.angles = vectoangles(self.velocity);
-               self.owner = world;
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
+               this.cnt++;
+               Send_Effect(EFFECT_HAGAR_BOUNCE, this.origin, this.velocity, 1);
+               this.angles = vectoangles(this.velocity);
+               this.owner = world;
+               this.projectiledeathtype |= HITTYPE_BOUNCE;
        }
 }
 
 void W_Hagar_Attack(Weapon thiswep, entity actor)
        }
 }
 
 void W_Hagar_Attack(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity missile;
 
        entity missile;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(hagar, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(hagar, ammo));
 
 
-       W_SetupShot(self, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
+       W_SetupShot(actor, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
 
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(missile);
 
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(missile);
-       missile.owner = missile.realowner = self;
+       missile.owner = missile.realowner = actor;
        missile.bot_dodge = true;
        missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
 
        missile.bot_dodge = true;
        missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
 
@@ -173,21 +173,21 @@ void W_Hagar_Attack(Weapon thiswep, entity actor)
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 void W_Hagar_Attack2(Weapon thiswep, entity actor)
 }
 
 void W_Hagar_Attack2(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity missile;
 
        entity missile;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(hagar, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo));
 
 
-       W_SetupShot(self, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+       W_SetupShot(actor, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
 
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(missile);
 
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(missile);
-       missile.owner = missile.realowner = self;
+       missile.owner = missile.realowner = actor;
        missile.bot_dodge = true;
        missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
        missile.bot_dodge = true;
        missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
@@ -216,12 +216,12 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor)
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
 
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 .float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
 void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity)
 }
 
 .float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
 void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity)
-{entity this = actor;
+{
        // time to release the rockets we've loaded
 
        entity missile;
        // time to release the rockets we've loaded
 
        entity missile;
@@ -229,24 +229,24 @@ void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity)
        vector s;
        vector forward, right, up;
 
        vector s;
        vector forward, right, up;
 
-       if(!self.hagar_load)
+       if(!actor.hagar_load)
                return;
 
                return;
 
-       weapon_prepareattack_do(self, weaponentity, true, WEP_CVAR_SEC(hagar, refire));
+       weapon_prepareattack_do(actor, weaponentity, true, WEP_CVAR_SEC(hagar, refire));
 
 
-       W_SetupShot(self, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+       W_SetupShot(actor, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        forward = v_forward;
        right = v_right;
        up = v_up;
 
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        forward = v_forward;
        right = v_right;
        up = v_up;
 
-       shots = self.hagar_load;
+       shots = actor.hagar_load;
        missile = world;
        for(counter = 0; counter < shots; ++counter)
        {
                missile = new(missile);
        missile = world;
        for(counter = 0; counter < shots; ++counter)
        {
                missile = new(missile);
-               missile.owner = missile.realowner = self;
+               missile.owner = missile.realowner = actor;
                missile.bot_dodge = true;
                missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
                missile.bot_dodge = true;
                missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
@@ -291,51 +291,51 @@ void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity)
 
                CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
 
                CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
-               MUTATOR_CALLHOOK(EditProjectile, self, missile);
+               MUTATOR_CALLHOOK(EditProjectile, actor, missile);
        }
 
        }
 
-       weapon_thinkf(self, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(hagar, load_animtime), w_ready);
-       self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, refire) * W_WeaponRateFactor(actor);
-       self.hagar_load = 0;
+       weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(hagar, load_animtime), w_ready);
+       actor.hagar_loadstep = time + WEP_CVAR_SEC(hagar, refire) * W_WeaponRateFactor(actor);
+       actor.hagar_load = 0;
 }
 
 void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
 }
 
 void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
-{entity this = actor;
+{
        // loadable hagar secondary attack, must always run each frame
 
        if(time < game_starttime)
                return;
 
        // loadable hagar secondary attack, must always run each frame
 
        if(time < game_starttime)
                return;
 
-       bool loaded = self.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
+       bool loaded = actor.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
 
        // this is different than WR_CHECKAMMO when it comes to reloading
        bool enough_ammo;
 
        // this is different than WR_CHECKAMMO when it comes to reloading
        bool enough_ammo;
-       if(self.items & IT_UNLIMITED_WEAPON_AMMO)
+       if(actor.items & IT_UNLIMITED_WEAPON_AMMO)
                enough_ammo = true;
        else if(autocvar_g_balance_hagar_reload_ammo)
                enough_ammo = true;
        else if(autocvar_g_balance_hagar_reload_ammo)
-               enough_ammo = self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
+               enough_ammo = actor.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
        else
        else
-               enough_ammo = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(hagar, ammo);
+               enough_ammo = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(hagar, ammo);
 
        bool stopped = loaded || !enough_ammo;
 
 
        bool stopped = loaded || !enough_ammo;
 
-       if(PHYS_INPUT_BUTTON_ATCK2(self))
+       if(PHYS_INPUT_BUTTON_ATCK2(actor))
        {
        {
-               if(PHYS_INPUT_BUTTON_ATCK(self) && WEP_CVAR_SEC(hagar, load_abort))
+               if(PHYS_INPUT_BUTTON_ATCK(actor) && WEP_CVAR_SEC(hagar, load_abort))
                {
                {
-                       if(self.hagar_load)
+                       if(actor.hagar_load)
                        {
                                // if we pressed primary fire while loading, unload all rockets and abort
                        {
                                // if we pressed primary fire while loading, unload all rockets and abort
-                               self.(weaponentity).state = WS_READY;
-                               W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo
-                               self.hagar_load = 0;
-                               sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
+                               actor.(weaponentity).state = WS_READY;
+                               W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo) * actor.hagar_load * -1); // give back ammo
+                               actor.hagar_load = 0;
+                               sound(actor, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
 
                                // pause until we can load rockets again, once we re-press the alt fire button
 
                                // pause until we can load rockets again, once we re-press the alt fire button
-                               self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor(actor);
+                               actor.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor(actor);
 
                                // require letting go of the alt fire button before we can load again
 
                                // require letting go of the alt fire button before we can load again
-                               self.hagar_loadblock = true;
+                               actor.hagar_loadblock = true;
                        }
                }
                else
                        }
                }
                else
@@ -343,65 +343,65 @@ void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
                        // check if we can attempt to load another rocket
                        if(!stopped)
                        {
                        // check if we can attempt to load another rocket
                        if(!stopped)
                        {
-                               if(!self.hagar_loadblock && self.hagar_loadstep < time)
+                               if(!actor.hagar_loadblock && actor.hagar_loadstep < time)
                                {
                                {
-                                       W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(hagar, ammo));
-                                       self.(weaponentity).state = WS_INUSE;
-                                       self.hagar_load += 1;
-                                       sound(self, CH_WEAPON_B, SND_HAGAR_LOAD, VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
+                                       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo));
+                                       actor.(weaponentity).state = WS_INUSE;
+                                       actor.hagar_load += 1;
+                                       sound(actor, CH_WEAPON_B, SND_HAGAR_LOAD, VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
 
 
-                                       if(self.hagar_load >= WEP_CVAR_SEC(hagar, load_max))
+                                       if(actor.hagar_load >= WEP_CVAR_SEC(hagar, load_max))
                                                stopped = true;
                                        else
                                                stopped = true;
                                        else
-                                               self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor(actor);
+                                               actor.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor(actor);
                                }
                        }
                                }
                        }
-                       if(stopped && !self.hagar_loadbeep && self.hagar_load) // prevents the beep from playing each frame
+                       if(stopped && !actor.hagar_loadbeep && actor.hagar_load) // prevents the beep from playing each frame
                        {
                                // if this is the last rocket we can load, play a beep sound to notify the player
                        {
                                // if this is the last rocket we can load, play a beep sound to notify the player
-                               sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
-                               self.hagar_loadbeep = true;
-                               self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_hold) * W_WeaponRateFactor(actor);
+                               sound(actor, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
+                               actor.hagar_loadbeep = true;
+                               actor.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_hold) * W_WeaponRateFactor(actor);
                        }
                }
        }
                        }
                }
        }
-       else if(self.hagar_loadblock)
+       else if(actor.hagar_loadblock)
        {
                // the alt fire button has been released, so re-enable loading if blocked
        {
                // the alt fire button has been released, so re-enable loading if blocked
-               self.hagar_loadblock = false;
+               actor.hagar_loadblock = false;
        }
 
        }
 
-       if(self.hagar_load)
+       if(actor.hagar_load)
        {
                // play warning sound if we're about to release
        {
                // play warning sound if we're about to release
-               if(stopped && self.hagar_loadstep - 0.5 < time && WEP_CVAR_SEC(hagar, load_hold) >= 0)
+               if(stopped && actor.hagar_loadstep - 0.5 < time && WEP_CVAR_SEC(hagar, load_hold) >= 0)
                {
                {
-                       if(!self.hagar_warning) // prevents the beep from playing each frame
+                       if(!actor.hagar_warning) // prevents the beep from playing each frame
                        {
                                // we're about to automatically release after holding time, play a beep sound to notify the player
                        {
                                // we're about to automatically release after holding time, play a beep sound to notify the player
-                               sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
-                               self.hagar_warning = true;
+                               sound(actor, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
+                               actor.hagar_warning = true;
                        }
                }
 
                // release if player let go of button or if they've held it in too long
                        }
                }
 
                // release if player let go of button or if they've held it in too long
-               if(!PHYS_INPUT_BUTTON_ATCK2(self) || (stopped && self.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
+               if(!PHYS_INPUT_BUTTON_ATCK2(actor) || (stopped && actor.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
                {
                {
-                       self.(weaponentity).state = WS_READY;
-                       W_Hagar_Attack2_Load_Release(self, weaponentity);
+                       actor.(weaponentity).state = WS_READY;
+                       W_Hagar_Attack2_Load_Release(actor, weaponentity);
                }
        }
        else
        {
                }
        }
        else
        {
-               self.hagar_loadbeep = false;
-               self.hagar_warning = false;
+               actor.hagar_loadbeep = false;
+               actor.hagar_warning = false;
 
                // we aren't checking ammo during an attack, so we must do it here
 
                // we aren't checking ammo during an attack, so we must do it here
-               if(!(thiswep.wr_checkammo1(thiswep, self) + thiswep.wr_checkammo2(thiswep, self)))
-               if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(!(thiswep.wr_checkammo1(thiswep, actor) + thiswep.wr_checkammo2(thiswep, actor)))
+               if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        // note: this doesn't force the switch
                {
                        // note: this doesn't force the switch
-                       W_SwitchToOtherWeapon(self);
+                       W_SwitchToOtherWeapon(actor);
                        return;
                }
        }
                        return;
                }
        }
@@ -439,11 +439,10 @@ void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int
 
 METHOD(Hagar, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(Hagar, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     if(random()>0.15)
     if(random()>0.15)
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
     else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
     else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
 }
 METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -481,13 +480,12 @@ METHOD(Hagar, wr_gonethink, void(entity thiswep, entity actor))
 }
 METHOD(Hagar, wr_setup, void(entity thiswep, entity actor))
 {
 }
 METHOD(Hagar, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.hagar_loadblock = false;
+    actor.hagar_loadblock = false;
 
 
-    if(self.hagar_load)
+    if(actor.hagar_load)
     {
     {
-        W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo if necessary
-        self.hagar_load = 0;
+        W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo) * actor.hagar_load * -1); // give back ammo if necessary
+        actor.hagar_load = 0;
     }
 }
 METHOD(Hagar, wr_checkammo1, bool(entity thiswep, entity actor))
     }
 }
 METHOD(Hagar, wr_checkammo1, bool(entity thiswep, entity actor))
@@ -504,8 +502,7 @@ METHOD(Hagar, wr_checkammo2, bool(entity thiswep, entity actor))
 }
 METHOD(Hagar, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Hagar, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.hagar_load = 0;
+    actor.hagar_load = 0;
 }
 METHOD(Hagar, wr_playerdeath, void(entity thiswep, entity actor))
 {
 }
 METHOD(Hagar, wr_playerdeath, void(entity thiswep, entity actor))
 {
@@ -516,9 +513,8 @@ METHOD(Hagar, wr_playerdeath, void(entity thiswep, entity actor))
 }
 METHOD(Hagar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
 }
 METHOD(Hagar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
-    entity this = actor;
-    if(!self.hagar_load) // require releasing loaded rockets first
-        W_Reload(self, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND_RELOAD);
+    if(!actor.hagar_load) // require releasing loaded rockets first
+        W_Reload(actor, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND_RELOAD);
 }
 METHOD(Hagar, wr_suicidemessage, Notification(entity thiswep))
 {
 }
 METHOD(Hagar, wr_suicidemessage, Notification(entity thiswep))
 {
@@ -537,18 +533,17 @@ METHOD(Hagar, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Hagar, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Hagar, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 6;
     pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     {
         if(w_random<0.15)
     vector org2;
     org2 = w_org + w_backoff * 6;
     pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     {
         if(w_random<0.15)
-            sound(self, CH_SHOTS, SND_HAGEXP1, VOL_BASE, ATTN_NORM);
+            sound(actor, CH_SHOTS, SND_HAGEXP1, VOL_BASE, ATTN_NORM);
         else if(w_random<0.7)
         else if(w_random<0.7)
-            sound(self, CH_SHOTS, SND_HAGEXP2, VOL_BASE, ATTN_NORM);
+            sound(actor, CH_SHOTS, SND_HAGEXP2, VOL_BASE, ATTN_NORM);
         else
         else
-            sound(self, CH_SHOTS, SND_HAGEXP3, VOL_BASE, ATTN_NORM);
+            sound(actor, CH_SHOTS, SND_HAGEXP3, VOL_BASE, ATTN_NORM);
     }
 }
 
     }
 }
 
index 9d82c34f22f384ac643e73672f0f291596bf0587..6b09f901154621c906d22d97b554a477ecc99fcb 100644 (file)
@@ -60,37 +60,37 @@ void W_HLAC_Touch(entity this)
 
        PROJECTILE_TOUCH(this);
 
 
        PROJECTILE_TOUCH(this);
 
-       self.event_damage = func_null;
+       this.event_damage = func_null;
 
 
-       isprimary = !(self.projectiledeathtype & HITTYPE_SECONDARY);
+       isprimary = !(this.projectiledeathtype & HITTYPE_SECONDARY);
 
 
-       RadiusDamage(self, self.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), world, world, WEP_CVAR_BOTH(hlac, isprimary, force), self.projectiledeathtype, other);
+       RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), world, world, WEP_CVAR_BOTH(hlac, isprimary, force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_HLAC_Attack(Weapon thiswep, entity actor)
 }
 
 void W_HLAC_Attack(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity missile;
     float spread;
 
        entity missile;
     float spread;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(hlac, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(hlac, ammo));
 
 
-    spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * self.misc_bulletcounter);
+    spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.misc_bulletcounter);
     spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
     spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
-    if(self.crouch)
+    if(actor.crouch)
         spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
 
         spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
 
-       W_SetupShot(self, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
+       W_SetupShot(actor, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
        Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
        if(!autocvar_g_norecoil)
        {
        Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
        if(!autocvar_g_norecoil)
        {
-               self.punchangle_x = random() - 0.5;
-               self.punchangle_y = random() - 0.5;
+               actor.punchangle_x = random() - 0.5;
+               actor.punchangle_y = random() - 0.5;
        }
 
        missile = new(hlacbolt);
        }
 
        missile = new(hlacbolt);
-       missile.owner = missile.realowner = self;
+       missile.owner = missile.realowner = actor;
        missile.bot_dodge = true;
 
     missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
        missile.bot_dodge = true;
 
     missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
@@ -114,25 +114,25 @@ void W_HLAC_Attack(Weapon thiswep, entity actor)
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 void W_HLAC_Attack2(entity actor)
 }
 
 void W_HLAC_Attack2(entity actor)
-{entity this = actor;
+{
        entity missile;
     float spread;
 
     spread = WEP_CVAR_SEC(hlac, spread);
 
 
        entity missile;
     float spread;
 
     spread = WEP_CVAR_SEC(hlac, spread);
 
 
-    if(self.crouch)
+    if(actor.crouch)
         spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
 
         spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
 
-       W_SetupShot(self, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
+       W_SetupShot(actor, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
        Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(hlacbolt);
        Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile = new(hlacbolt);
-       missile.owner = missile.realowner = self;
+       missile.owner = missile.realowner = actor;
        missile.bot_dodge = true;
 
     missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
        missile.bot_dodge = true;
 
     missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
@@ -157,7 +157,7 @@ void W_HLAC_Attack2(entity actor)
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 // weapon frames
 }
 
 // weapon frames
@@ -192,25 +192,24 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int
 }
 
 void W_HLAC_Attack2_Frame(Weapon thiswep, entity actor)
 }
 
 void W_HLAC_Attack2_Frame(Weapon thiswep, entity actor)
-{entity this = actor;
+{
     float i;
 
     float i;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(hlac, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hlac, ammo));
 
     for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
         W_HLAC_Attack2(actor);
 
        if(!autocvar_g_norecoil)
        {
 
     for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
         W_HLAC_Attack2(actor);
 
        if(!autocvar_g_norecoil)
        {
-               self.punchangle_x = random() - 0.5;
-               self.punchangle_y = random() - 0.5;
+               actor.punchangle_x = random() - 0.5;
+               actor.punchangle_y = random() - 0.5;
        }
 }
 
 METHOD(HLAC, wr_aim, void(entity thiswep, entity actor))
 {
        }
 }
 
 METHOD(HLAC, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
 }
 METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -265,12 +264,11 @@ METHOD(HLAC, wr_killmessage, Notification(entity thiswep))
 
 METHOD(HLAC, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(HLAC, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 6;
     pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 6;
     pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM);
+        sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM);
 }
 
 #endif
 }
 
 #endif
index 5919611107dc32b01e2871e91c991092b9c61737..8bfc9ebc025231495f284dd5170c8af9358c26ad 100644 (file)
@@ -83,39 +83,39 @@ void W_Hook_ExplodeThink(entity this)
 {
        float dt, dmg_remaining_next, f;
 
 {
        float dt, dmg_remaining_next, f;
 
-       dt = time - self.teleport_time;
-       dmg_remaining_next = pow(bound(0, 1 - dt / self.dmg_duration, 1), self.dmg_power);
+       dt = time - this.teleport_time;
+       dmg_remaining_next = pow(bound(0, 1 - dt / this.dmg_duration, 1), this.dmg_power);
 
 
-       f = self.dmg_last - dmg_remaining_next;
-       self.dmg_last = dmg_remaining_next;
+       f = this.dmg_last - dmg_remaining_next;
+       this.dmg_last = dmg_remaining_next;
 
 
-       RadiusDamage(self, self.realowner, self.dmg * f, self.dmg_edge * f, self.dmg_radius, self.realowner, world, self.dmg_force * f, self.projectiledeathtype, world);
-       self.projectiledeathtype |= HITTYPE_BOUNCE;
-       //RadiusDamage(self, world, self.dmg * f, self.dmg_edge * f, self.dmg_radius, world, world, self.dmg_force * f, self.projectiledeathtype, world);
+       RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, world, this.dmg_force * f, this.projectiledeathtype, world);
+       this.projectiledeathtype |= HITTYPE_BOUNCE;
+       //RadiusDamage(this, world, this.dmg * f, this.dmg_edge * f, this.dmg_radius, world, world, this.dmg_force * f, this.projectiledeathtype, world);
 
 
-       if(dt < self.dmg_duration)
-               self.nextthink = time + 0.05; // soon
+       if(dt < this.dmg_duration)
+               this.nextthink = time + 0.05; // soon
        else
        else
-               remove(self);
+               remove(this);
 }
 
 void W_Hook_Explode2(entity this)
 {
 }
 
 void W_Hook_Explode2(entity this)
 {
-       self.event_damage = func_null;
-       settouch(self, func_null);
-       self.effects |= EF_NODRAW;
-
-       setthink(self, W_Hook_ExplodeThink);
-       self.nextthink = time;
-       self.dmg = WEP_CVAR_SEC(hook, damage);
-       self.dmg_edge = WEP_CVAR_SEC(hook, edgedamage);
-       self.dmg_radius = WEP_CVAR_SEC(hook, radius);
-       self.dmg_force = WEP_CVAR_SEC(hook, force);
-       self.dmg_power = WEP_CVAR_SEC(hook, power);
-       self.dmg_duration = WEP_CVAR_SEC(hook, duration);
-       self.teleport_time = time;
-       self.dmg_last = 1;
-       self.movetype = MOVETYPE_NONE;
+       this.event_damage = func_null;
+       settouch(this, func_null);
+       this.effects |= EF_NODRAW;
+
+       setthink(this, W_Hook_ExplodeThink);
+       this.nextthink = time;
+       this.dmg = WEP_CVAR_SEC(hook, damage);
+       this.dmg_edge = WEP_CVAR_SEC(hook, edgedamage);
+       this.dmg_radius = WEP_CVAR_SEC(hook, radius);
+       this.dmg_force = WEP_CVAR_SEC(hook, force);
+       this.dmg_power = WEP_CVAR_SEC(hook, power);
+       this.dmg_duration = WEP_CVAR_SEC(hook, duration);
+       this.teleport_time = time;
+       this.dmg_last = 1;
+       this.movetype = MOVETYPE_NONE;
 }
 
 void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
 }
 
 void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
@@ -279,8 +279,7 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity,
 }
 METHOD(Hook, wr_setup, void(entity thiswep, entity actor))
 {
 }
 METHOD(Hook, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
+    actor.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
 }
 METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor))
 {
 }
 METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor))
 {
@@ -297,10 +296,9 @@ METHOD(Hook, wr_checkammo2, bool(Hook thiswep, entity actor))
 }
 METHOD(Hook, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Hook, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    RemoveGrapplingHook(self);
-    self.hook_time = 0;
-    self.hook_refire = time;
+    RemoveGrapplingHook(actor);
+    actor.hook_time = 0;
+    actor.hook_refire = time;
 }
 METHOD(Hook, wr_killmessage, Notification(entity thiswep))
 {
 }
 METHOD(Hook, wr_killmessage, Notification(entity thiswep))
 {
@@ -312,12 +310,11 @@ METHOD(Hook, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
+        sound(actor, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
 }
 
 #endif
 }
 
 #endif
index 2bf2f18bdf7aa77d31f39270f8900ec695982743..03c305ca954318b6e222500966ec365dc833a26e 100644 (file)
@@ -89,53 +89,53 @@ void W_MachineGun_MuzzleFlash_Think(entity this)
 }
 
 void W_MachineGun_MuzzleFlash(entity actor)
 }
 
 void W_MachineGun_MuzzleFlash(entity actor)
-{entity this = actor;
-       if(self.muzzle_flash == world)
-               self.muzzle_flash = spawn();
+{
+       if(actor.muzzle_flash == world)
+               actor.muzzle_flash = spawn();
 
        // muzzle flash for 1st person view
 
        // muzzle flash for 1st person view
-       setmodel(self.muzzle_flash, MDL_MACHINEGUN_MUZZLEFLASH); // precision set below
-
-       self.muzzle_flash.scale = 0.75;
-       setthink(self.muzzle_flash, W_MachineGun_MuzzleFlash_Think);
-       self.muzzle_flash.nextthink = time + 0.02;
-       self.muzzle_flash.frame = 2;
-       self.muzzle_flash.alpha = 0.75;
-       self.muzzle_flash.angles_z = random() * 180;
-       self.muzzle_flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-       self.muzzle_flash.owner = self.muzzle_flash.realowner = self;
+       setmodel(actor.muzzle_flash, MDL_MACHINEGUN_MUZZLEFLASH); // precision set below
+
+       actor.muzzle_flash.scale = 0.75;
+       setthink(actor.muzzle_flash, W_MachineGun_MuzzleFlash_Think);
+       actor.muzzle_flash.nextthink = time + 0.02;
+       actor.muzzle_flash.frame = 2;
+       actor.muzzle_flash.alpha = 0.75;
+       actor.muzzle_flash.angles_z = random() * 180;
+       actor.muzzle_flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+       actor.muzzle_flash.owner = actor.muzzle_flash.realowner = actor;
 }
 
 void W_MachineGun_Attack(Weapon thiswep, int deathtype, entity actor, .entity weaponentity)
 }
 
 void W_MachineGun_Attack(Weapon thiswep, int deathtype, entity actor, .entity weaponentity)
-{entity this = actor;
-       W_SetupShot(self, true, 0, SND_UZI_FIRE, CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
+{
+       W_SetupShot(actor, true, 0, SND_UZI_FIRE, CH_WEAPON_A, ((actor.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
        if(!autocvar_g_norecoil)
        {
        if(!autocvar_g_norecoil)
        {
-               self.punchangle_x = random() - 0.5;
-               self.punchangle_y = random() - 0.5;
+               actor.punchangle_x = random() - 0.5;
+               actor.punchangle_y = random() - 0.5;
        }
        int slot = weaponslot(weaponentity);
        // this attack_finished just enforces a cooldown at the end of a burst
        }
        int slot = weaponslot(weaponentity);
        // this attack_finished just enforces a cooldown at the end of a burst
-       ATTACK_FINISHED(self, slot) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor(actor);
+       ATTACK_FINISHED(actor, slot) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor(actor);
 
 
-       if(self.misc_bulletcounter == 1)
-               fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
+       if(actor.misc_bulletcounter == 1)
+               fireBullet(actor, w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
        else
        else
-               fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
+               fireBullet(actor, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
 
        Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
 
        Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
-       W_MachineGun_MuzzleFlash(self);
-       W_AttachToShotorg(self, self.muzzle_flash, '5 0 0');
+       W_MachineGun_MuzzleFlash(actor);
+       W_AttachToShotorg(actor, actor.muzzle_flash, '5 0 0');
 
        // casing code
        if(autocvar_g_casings >= 2)
 
        // casing code
        if(autocvar_g_casings >= 2)
-               SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
+               SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, actor);
 
 
-       if(self.misc_bulletcounter == 1)
-               W_DecreaseAmmo(thiswep, self, WEP_CVAR(machinegun, first_ammo));
+       if(actor.misc_bulletcounter == 1)
+               W_DecreaseAmmo(thiswep, actor, WEP_CVAR(machinegun, first_ammo));
        else
        else
-               W_DecreaseAmmo(thiswep, self, WEP_CVAR(machinegun, sustained_ammo));
+               W_DecreaseAmmo(thiswep, actor, WEP_CVAR(machinegun, sustained_ammo));
 }
 
 // weapon frames
 }
 
 // weapon frames
@@ -244,11 +244,10 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit
 
 METHOD(MachineGun, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(MachineGun, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false);
+    if(vdist(actor.origin - actor.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
     else
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
 }
 METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -356,12 +355,11 @@ METHOD(MachineGun, wr_killmessage, Notification(entity thiswep))
 
 METHOD(MachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(MachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
+        sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
 }
 
 #endif
 }
 
 #endif
index bc7f8eb39efbe6be32be3d9cb757bf355af3c402..14a1c6491c9bfb99ee0fff6824f81ae0bb906c27 100644 (file)
@@ -65,44 +65,44 @@ spawnfunc(weapon_minelayer) { weapon_defaultspawnfunc(this, WEP_MINE_LAYER); }
 
 void W_MineLayer_Stick(entity this, entity to)
 {
 
 void W_MineLayer_Stick(entity this, entity to)
 {
-       spamsound(self, CH_SHOTS, SND(MINE_STICK), VOL_BASE, ATTN_NORM);
+       spamsound(this, CH_SHOTS, SND(MINE_STICK), VOL_BASE, ATTN_NORM);
 
        // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
 
        entity newmine = spawn();
 
        // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
 
        entity newmine = spawn();
-       newmine.classname = self.classname;
+       newmine.classname = this.classname;
 
 
-       newmine.bot_dodge = self.bot_dodge;
-       newmine.bot_dodgerating = self.bot_dodgerating;
+       newmine.bot_dodge = this.bot_dodge;
+       newmine.bot_dodgerating = this.bot_dodgerating;
 
 
-       newmine.owner = self.owner;
-       newmine.realowner = self.realowner;
+       newmine.owner = this.owner;
+       newmine.realowner = this.realowner;
        setsize(newmine, '-4 -4 -4', '4 4 4');
        setsize(newmine, '-4 -4 -4', '4 4 4');
-       setorigin(newmine, self.origin);
+       setorigin(newmine, this.origin);
        setmodel(newmine, MDL_MINELAYER_MINE);
        newmine.angles = vectoangles(-trace_plane_normal); // face against the surface
 
        newmine.mine_orientation = -trace_plane_normal;
 
        setmodel(newmine, MDL_MINELAYER_MINE);
        newmine.angles = vectoangles(-trace_plane_normal); // face against the surface
 
        newmine.mine_orientation = -trace_plane_normal;
 
-       newmine.takedamage = self.takedamage;
-       newmine.damageforcescale = self.damageforcescale;
-       newmine.health = self.health;
-       newmine.event_damage = self.event_damage;
-       newmine.spawnshieldtime = self.spawnshieldtime;
+       newmine.takedamage = this.takedamage;
+       newmine.damageforcescale = this.damageforcescale;
+       newmine.health = this.health;
+       newmine.event_damage = this.event_damage;
+       newmine.spawnshieldtime = this.spawnshieldtime;
        newmine.damagedbycontents = true;
 
        newmine.movetype = MOVETYPE_NONE; // lock the mine in place
        newmine.damagedbycontents = true;
 
        newmine.movetype = MOVETYPE_NONE; // lock the mine in place
-       newmine.projectiledeathtype = self.projectiledeathtype;
+       newmine.projectiledeathtype = this.projectiledeathtype;
 
 
-       newmine.mine_time = self.mine_time;
+       newmine.mine_time = this.mine_time;
 
        settouch(newmine, func_null);
        setthink(newmine, W_MineLayer_Think);
        newmine.nextthink = time;
 
        settouch(newmine, func_null);
        setthink(newmine, W_MineLayer_Think);
        newmine.nextthink = time;
-       newmine.cnt = self.cnt;
-       newmine.flags = self.flags;
+       newmine.cnt = this.cnt;
+       newmine.flags = this.flags;
 
 
-       remove(self);
+       remove(this);
 
        if(to)
                SetMovetypeFollow(newmine, to);
 
        if(to)
                SetMovetypeFollow(newmine, to);
@@ -112,17 +112,17 @@ void W_MineLayer_Explode(entity this)
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
-                       if(DIFF_TEAM(self.realowner, other))
+                       if(DIFF_TEAM(this.realowner, other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
-                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
+                                               Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
 
-       RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), self.projectiledeathtype, other);
+       RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), this.projectiledeathtype, other);
 
 
-       if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
+       if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
        {
                entity own = this.realowner;
                Weapon w = WEP_MINE_LAYER;
        {
                entity own = this.realowner;
                Weapon w = WEP_MINE_LAYER;
@@ -134,21 +134,21 @@ void W_MineLayer_Explode(entity this)
                        PS(own).m_switchweapon = w_getbestweapon(own);
                }
        }
                        PS(own).m_switchweapon = w_getbestweapon(own);
                }
        }
-       self.realowner.minelayer_mines -= 1;
-       remove(self);
+       this.realowner.minelayer_mines -= 1;
+       remove(this);
 }
 
 void W_MineLayer_DoRemoteExplode(entity this)
 {
 }
 
 void W_MineLayer_DoRemoteExplode(entity this)
 {
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
 
-       if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
-               self.velocity = self.mine_orientation; // particle fx and decals need .velocity
+       if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW)
+               this.velocity = this.mine_orientation; // particle fx and decals need .velocity
 
 
-       RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), self.projectiledeathtype | HITTYPE_BOUNCE, world);
+       RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, world);
 
 
-       if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
+       if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
        {
                entity own = this.realowner;
                Weapon w = WEP_MINE_LAYER;
        {
                entity own = this.realowner;
                Weapon w = WEP_MINE_LAYER;
@@ -161,38 +161,38 @@ void W_MineLayer_DoRemoteExplode(entity this)
                }
        }
        this.realowner.minelayer_mines -= 1;
                }
        }
        this.realowner.minelayer_mines -= 1;
-       remove(self);
+       remove(this);
 }
 
 void W_MineLayer_RemoteExplode(entity this)
 {
 }
 
 void W_MineLayer_RemoteExplode(entity this)
 {
-       if(!IS_DEAD(self.realowner))
-               if((self.spawnshieldtime >= 0)
-                       ? (time >= self.spawnshieldtime) // timer
-                       : (vdist(NearestPointOnBox(self.realowner, self.origin) - self.origin, >, WEP_CVAR(minelayer, remote_radius))) // safety device
+       if(!IS_DEAD(this.realowner))
+               if((this.spawnshieldtime >= 0)
+                       ? (time >= this.spawnshieldtime) // timer
+                       : (vdist(NearestPointOnBox(this.realowner, this.origin) - this.origin, >, WEP_CVAR(minelayer, remote_radius))) // safety device
                )
                {
                )
                {
-                       W_MineLayer_DoRemoteExplode(self);
+                       W_MineLayer_DoRemoteExplode(this);
                }
 }
 
 void W_MineLayer_ProximityExplode(entity this)
 {
        // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
                }
 }
 
 void W_MineLayer_ProximityExplode(entity this)
 {
        // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
-       if(WEP_CVAR(minelayer, protection) && self.mine_explodeanyway == 0)
+       if(WEP_CVAR(minelayer, protection) && this.mine_explodeanyway == 0)
        {
                entity head;
        {
                entity head;
-               head = findradius(self.origin, WEP_CVAR(minelayer, radius));
+               head = findradius(this.origin, WEP_CVAR(minelayer, radius));
                while(head)
                {
                while(head)
                {
-                       if(head == self.realowner || SAME_TEAM(head, self.realowner))
+                       if(head == this.realowner || SAME_TEAM(head, this.realowner))
                                return;
                        head = head.chain;
                }
        }
 
                                return;
                        head = head.chain;
                }
        }
 
-       self.mine_time = 0;
-       W_MineLayer_Explode(self);
+       this.mine_time = 0;
+       W_MineLayer_Explode(this);
 }
 
 int W_MineLayer_Count(entity e)
 }
 
 int W_MineLayer_Count(entity e)
@@ -209,74 +209,74 @@ void W_MineLayer_Think(entity this)
 {
        entity head;
 
 {
        entity head;
 
-       self.nextthink = time;
+       this.nextthink = time;
 
 
-       if(self.movetype == MOVETYPE_FOLLOW)
+       if(this.movetype == MOVETYPE_FOLLOW)
        {
        {
-               if(LostMovetypeFollow(self))
+               if(LostMovetypeFollow(this))
                {
                {
-                       UnsetMovetypeFollow(self);
-                       self.movetype = MOVETYPE_NONE;
+                       UnsetMovetypeFollow(this);
+                       this.movetype = MOVETYPE_NONE;
                }
        }
 
        // our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
        // TODO: replace this mine_trigger.wav sound with a real countdown
                }
        }
 
        // our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
        // TODO: replace this mine_trigger.wav sound with a real countdown
-       if((time > self.cnt) && (!self.mine_time) && (self.cnt > 0))
+       if((time > this.cnt) && (!this.mine_time) && (this.cnt > 0))
        {
                if(WEP_CVAR(minelayer, lifetime_countdown) > 0)
        {
                if(WEP_CVAR(minelayer, lifetime_countdown) > 0)
-                       spamsound(self, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
-               self.mine_time = time + WEP_CVAR(minelayer, lifetime_countdown);
-               self.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
+                       spamsound(this, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
+               this.mine_time = time + WEP_CVAR(minelayer, lifetime_countdown);
+               this.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
        }
 
        // a player's mines shall explode if he disconnects or dies
        // TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
        }
 
        // a player's mines shall explode if he disconnects or dies
        // TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
-       if(!IS_PLAYER(self.realowner) || IS_DEAD(self.realowner) || STAT(FROZEN, self.realowner))
+       if(!IS_PLAYER(this.realowner) || IS_DEAD(this.realowner) || STAT(FROZEN, this.realowner))
        {
                other = world;
        {
                other = world;
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
-               W_MineLayer_Explode(self);
+               this.projectiledeathtype |= HITTYPE_BOUNCE;
+               W_MineLayer_Explode(this);
                return;
        }
 
        // set the mine for detonation when a foe gets close enough
                return;
        }
 
        // set the mine for detonation when a foe gets close enough
-       head = findradius(self.origin, WEP_CVAR(minelayer, proximityradius));
+       head = findradius(this.origin, WEP_CVAR(minelayer, proximityradius));
        while(head)
        {
                if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head))
        while(head)
        {
                if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head))
-               if(head != self.realowner && DIFF_TEAM(head, self.realowner)) // don't trigger for team mates
-               if(!self.mine_time)
+               if(head != this.realowner && DIFF_TEAM(head, this.realowner)) // don't trigger for team mates
+               if(!this.mine_time)
                {
                {
-                       spamsound(self, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
-                       self.mine_time = time + WEP_CVAR(minelayer, time);
+                       spamsound(this, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
+                       this.mine_time = time + WEP_CVAR(minelayer, time);
                }
                head = head.chain;
        }
 
        // explode if it's time to
                }
                head = head.chain;
        }
 
        // explode if it's time to
-       if(self.mine_time && time >= self.mine_time)
+       if(this.mine_time && time >= this.mine_time)
        {
        {
-               W_MineLayer_ProximityExplode(self);
+               W_MineLayer_ProximityExplode(this);
                return;
        }
 
        // remote detonation
                return;
        }
 
        // remote detonation
-       if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
-       if(!IS_DEAD(self.realowner))
-       if(self.minelayer_detonate)
-               W_MineLayer_RemoteExplode(self);
+       if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
+       if(!IS_DEAD(this.realowner))
+       if(this.minelayer_detonate)
+               W_MineLayer_RemoteExplode(this);
 }
 
 void W_MineLayer_Touch(entity this)
 {
 }
 
 void W_MineLayer_Touch(entity this)
 {
-       if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
+       if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW)
                return; // we're already a stuck mine, why do we get called? TODO does this even happen?
 
                return; // we're already a stuck mine, why do we get called? TODO does this even happen?
 
-       if(WarpZone_Projectile_Touch(self))
+       if(WarpZone_Projectile_Touch(this))
        {
        {
-               if(wasfreed(self))
-                       self.realowner.minelayer_mines -= 1;
+               if(wasfreed(this))
+                       this.realowner.minelayer_mines -= 1;
                return;
        }
 
                return;
        }
 
@@ -287,7 +287,7 @@ void W_MineLayer_Touch(entity this)
        }
        else
        {
        }
        else
        {
-               W_MineLayer_Stick(self, other);
+               W_MineLayer_Stick(this, other);
        }
 }
 
        }
 }
 
@@ -309,29 +309,29 @@ void W_MineLayer_Damage(entity this, entity inflictor, entity attacker, float da
 }
 
 void W_MineLayer_Attack(Weapon thiswep, entity actor)
 }
 
 void W_MineLayer_Attack(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity mine;
        entity flash;
 
        // scan how many mines we placed, and return if we reached our limit
        if(WEP_CVAR(minelayer, limit))
        {
        entity mine;
        entity flash;
 
        // scan how many mines we placed, and return if we reached our limit
        if(WEP_CVAR(minelayer, limit))
        {
-               if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
+               if(actor.minelayer_mines >= WEP_CVAR(minelayer, limit))
                {
                        // the refire delay keeps this message from being spammed
                {
                        // the refire delay keeps this message from being spammed
-                       Send_Notification(NOTIF_ONE, self, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
-                       play2(self, SND(UNAVAILABLE));
+                       Send_Notification(NOTIF_ONE, actor, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
+                       play2(actor, SND(UNAVAILABLE));
                        return;
                }
        }
 
                        return;
                }
        }
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR(minelayer, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR(minelayer, ammo));
 
 
-       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage));
+       W_SetupShot_ProjectileSize(actor, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage));
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
-       mine = WarpZone_RefSys_SpawnSameRefSys(self);
-       mine.owner = mine.realowner = self;
+       mine = WarpZone_RefSys_SpawnSameRefSys(actor);
+       mine.owner = mine.realowner = actor;
        if(WEP_CVAR(minelayer, detonatedelay) >= 0)
                mine.spawnshieldtime = time + WEP_CVAR(minelayer, detonatedelay);
        else
        if(WEP_CVAR(minelayer, detonatedelay) >= 0)
                mine.spawnshieldtime = time + WEP_CVAR(minelayer, detonatedelay);
        else
@@ -371,13 +371,13 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor)
        setmodel(flash, MDL_MINELAYER_MUZZLEFLASH); // precision set below
        SUB_SetFade(flash, time, 0.1);
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
        setmodel(flash, MDL_MINELAYER_MUZZLEFLASH); // precision set below
        SUB_SetFade(flash, time, 0.1);
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-       W_AttachToShotorg(self, flash, '5 0 0');
+       W_AttachToShotorg(actor, flash, '5 0 0');
 
        // common properties
 
 
        // common properties
 
-       MUTATOR_CALLHOOK(EditProjectile, self, mine);
+       MUTATOR_CALLHOOK(EditProjectile, actor, mine);
 
 
-       self.minelayer_mines = W_MineLayer_Count(self);
+       actor.minelayer_mines = W_MineLayer_Count(actor);
 }
 
 float W_MineLayer_PlacedMines(entity this, float detonate)
 }
 
 float W_MineLayer_PlacedMines(entity this, float detonate)
@@ -403,12 +403,11 @@ float W_MineLayer_PlacedMines(entity this, float detonate)
 
 METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     // aim and decide to fire if appropriate
     // aim and decide to fire if appropriate
-    if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
-        PHYS_INPUT_BUTTON_ATCK(self) = false;
+    if(actor.minelayer_mines >= WEP_CVAR(minelayer, limit))
+        PHYS_INPUT_BUTTON_ATCK(actor) = false;
     else
     else
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
     if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
     {
         // decide whether to detonate mines
     if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
     {
         // decide whether to detonate mines
@@ -426,7 +425,7 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
         entity mine = find(world, classname, "mine");
         while(mine)
         {
         entity mine = find(world, classname, "mine");
         while(mine)
         {
-            if(mine.realowner != self)
+            if(mine.realowner != actor)
             {
                 mine = find(mine, classname, "mine");
                 continue;
             {
                 mine = find(mine, classname, "mine");
                 continue;
@@ -437,11 +436,11 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
                 d = vlen(targ.origin + (targ.mins + targ.maxs) * 0.5 - mine.origin);
                 d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
                 // count potential damage according to type of target
                 d = vlen(targ.origin + (targ.mins + targ.maxs) * 0.5 - mine.origin);
                 d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
                 // count potential damage according to type of target
-                if(targ == self)
+                if(targ == actor)
                     selfdamage = selfdamage + d;
                     selfdamage = selfdamage + d;
-                else if(targ.team == self.team && teamplay)
+                else if(targ.team == actor.team && teamplay)
                     teamdamage = teamdamage + d;
                     teamdamage = teamdamage + d;
-                else if(bot_shouldattack(self, targ))
+                else if(bot_shouldattack(actor, targ))
                     enemydamage = enemydamage + d;
                 targ = targ.chain;
             }
                     enemydamage = enemydamage + d;
                 targ = targ.chain;
             }
@@ -449,15 +448,15 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
         }
         float desirabledamage;
         desirabledamage = enemydamage;
         }
         float desirabledamage;
         desirabledamage = enemydamage;
-        if(time > self.invincible_finished && time > self.spawnshieldtime)
+        if(time > actor.invincible_finished && time > actor.spawnshieldtime)
             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
-        if(teamplay && self.team)
+        if(teamplay && actor.team)
             desirabledamage = desirabledamage - teamdamage;
 
         mine = find(world, classname, "mine");
         while(mine)
         {
             desirabledamage = desirabledamage - teamdamage;
 
         mine = find(world, classname, "mine");
         while(mine)
         {
-            if(mine.realowner != self)
+            if(mine.realowner != actor)
             {
                 mine = find(mine, classname, "mine");
                 continue;
             {
                 mine = find(mine, classname, "mine");
                 continue;
@@ -472,18 +471,18 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
                     if(
                         (v_forward * normalize(mine.origin - targ.origin)< 0.1)
                         && desirabledamage > 0.1*coredamage
                     if(
                         (v_forward * normalize(mine.origin - targ.origin)< 0.1)
                         && desirabledamage > 0.1*coredamage
-                    ) PHYS_INPUT_BUTTON_ATCK2(self) = true;
+                    ) PHYS_INPUT_BUTTON_ATCK2(actor) = true;
                     targ = targ.chain;
                 }
             }else{
                     targ = targ.chain;
                 }
             }else{
-                float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000);
+                float distance; distance= bound(300,vlen(actor.origin-actor.enemy.origin),30000);
                 //As the distance gets larger, a correct detonation gets near imposible
                 //Bots are assumed to use the mine spawnfunc_light to see if the mine gets near a player
                 //As the distance gets larger, a correct detonation gets near imposible
                 //Bots are assumed to use the mine spawnfunc_light to see if the mine gets near a player
-                if(v_forward * normalize(mine.origin - self.enemy.origin)< 0.1)
-                    if(IS_PLAYER(self.enemy))
+                if(v_forward * normalize(mine.origin - actor.enemy.origin)< 0.1)
+                    if(IS_PLAYER(actor.enemy))
                         if(desirabledamage >= 0.1*coredamage)
                             if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
                         if(desirabledamage >= 0.1*coredamage)
                             if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
-                                PHYS_INPUT_BUTTON_ATCK2(self) = true;
+                                PHYS_INPUT_BUTTON_ATCK2(actor) = true;
             // dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
             }
 
             // dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
             }
 
@@ -492,12 +491,12 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
         // if we would be doing at X percent of the core damage, detonate it
         // but don't fire a new shot at the same time!
         if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
         // if we would be doing at X percent of the core damage, detonate it
         // but don't fire a new shot at the same time!
         if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
-            PHYS_INPUT_BUTTON_ATCK2(self) = true;
-        if((skill > 6.5) && (selfdamage > self.health))
-            PHYS_INPUT_BUTTON_ATCK2(self) = false;
-        //if(PHYS_INPUT_BUTTON_ATCK2(self) == true)
+            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
+        if((skill > 6.5) && (selfdamage > actor.health))
+            PHYS_INPUT_BUTTON_ATCK2(actor) = false;
+        //if(PHYS_INPUT_BUTTON_ATCK2(actor) == true)
         //     dprint(ftos(desirabledamage),"\n");
         //     dprint(ftos(desirabledamage),"\n");
-        if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
+        if(PHYS_INPUT_BUTTON_ATCK2(actor)) PHYS_INPUT_BUTTON_ATCK(actor) = false;
     }
 }
 METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
     }
 }
 METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
@@ -565,12 +564,11 @@ METHOD(MineLayer, wr_killmessage, Notification(entity thiswep))
 
 METHOD(MineLayer, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(MineLayer, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
+        sound(actor, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
 }
 
 #endif
 }
 
 #endif
index 843eaa86bca170f6a9de49ba011c52cc05b792f4..8825fc0c54c3003f3635ec241505921a3d43ee24 100644 (file)
@@ -68,20 +68,20 @@ void W_Mortar_Grenade_Explode(entity this)
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
-                       if(DIFF_TEAM(self.realowner, other))
+                       if(DIFF_TEAM(this.realowner, other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
-                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
+                                               Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
 
-       if(self.movetype == MOVETYPE_NONE)
-               self.velocity = self.oldvelocity;
+       if(this.movetype == MOVETYPE_NONE)
+               this.velocity = this.oldvelocity;
 
 
-       RadiusDamage(self, self.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), world, world, WEP_CVAR_PRI(mortar, force), self.projectiledeathtype, other);
+       RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), world, world, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_Mortar_Grenade_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_Mortar_Grenade_Explode_use(entity this, entity actor, entity trigger)
@@ -93,20 +93,20 @@ void W_Mortar_Grenade_Explode2(entity this)
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
-                       if(DIFF_TEAM(self.realowner, other))
+                       if(DIFF_TEAM(this.realowner, other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
-                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
+                                               Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
 
 
-       if(self.movetype == MOVETYPE_NONE)
-               self.velocity = self.oldvelocity;
+       if(this.movetype == MOVETYPE_NONE)
+               this.velocity = this.oldvelocity;
 
 
-       RadiusDamage(self, self.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), world, world, WEP_CVAR_SEC(mortar, force), self.projectiledeathtype, other);
+       RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), world, world, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_Mortar_Grenade_Explode2_use(entity this, entity actor, entity trigger)
 }
 
 void W_Mortar_Grenade_Explode2_use(entity this, entity actor, entity trigger)
@@ -130,16 +130,16 @@ void W_Mortar_Grenade_Damage(entity this, entity inflictor, entity attacker, flo
 
 void W_Mortar_Grenade_Think1(entity this)
 {
 
 void W_Mortar_Grenade_Think1(entity this)
 {
-       self.nextthink = time;
-       if(time > self.cnt)
+       this.nextthink = time;
+       if(time > this.cnt)
        {
                other = world;
        {
                other = world;
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
-               W_Mortar_Grenade_Explode(self);
+               this.projectiledeathtype |= HITTYPE_BOUNCE;
+               W_Mortar_Grenade_Explode(this);
                return;
        }
                return;
        }
-       if(self.gl_detonate_later && self.gl_bouncecnt >= WEP_CVAR_PRI(mortar, remote_minbouncecnt))
-               W_Mortar_Grenade_Explode(self);
+       if(this.gl_detonate_later && this.gl_bouncecnt >= WEP_CVAR_PRI(mortar, remote_minbouncecnt))
+               W_Mortar_Grenade_Explode(this);
 }
 
 void W_Mortar_Grenade_Touch1(entity this)
 }
 
 void W_Mortar_Grenade_Touch1(entity this)
@@ -151,26 +151,26 @@ void W_Mortar_Grenade_Touch1(entity this)
        }
        else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
        {
        }
        else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
        {
-               spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM);
-               Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1);
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
-               self.gl_bouncecnt += 1;
+               spamsound(this, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM);
+               Send_Effect(EFFECT_HAGAR_BOUNCE, this.origin, this.velocity, 1);
+               this.projectiledeathtype |= HITTYPE_BOUNCE;
+               this.gl_bouncecnt += 1;
        }
        else if(WEP_CVAR_PRI(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
        }
        else if(WEP_CVAR_PRI(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
-               spamsound(self, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
+               spamsound(this, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
 
                // let it stick whereever it is
 
                // let it stick whereever it is
-               self.oldvelocity = self.velocity;
-               self.velocity = '0 0 0';
-               self.movetype = MOVETYPE_NONE; // also disables gravity
-               self.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
-               UpdateCSQCProjectile(self);
+               this.oldvelocity = this.velocity;
+               this.velocity = '0 0 0';
+               this.movetype = MOVETYPE_NONE; // also disables gravity
+               this.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
+               UpdateCSQCProjectile(this);
 
                // do not respond to any more touches
 
                // do not respond to any more touches
-               self.solid = SOLID_NOT;
+               this.solid = SOLID_NOT;
 
 
-               self.nextthink = min(self.nextthink, time + WEP_CVAR_PRI(mortar, lifetime_stick));
+               this.nextthink = min(this.nextthink, time + WEP_CVAR_PRI(mortar, lifetime_stick));
        }
 }
 
        }
 }
 
@@ -183,46 +183,46 @@ void W_Mortar_Grenade_Touch2(entity this)
        }
        else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
        {
        }
        else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
        {
-               spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM);
-               Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1);
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
-               self.gl_bouncecnt += 1;
+               spamsound(this, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM);
+               Send_Effect(EFFECT_HAGAR_BOUNCE, this.origin, this.velocity, 1);
+               this.projectiledeathtype |= HITTYPE_BOUNCE;
+               this.gl_bouncecnt += 1;
 
 
-               if(WEP_CVAR_SEC(mortar, lifetime_bounce) && self.gl_bouncecnt == 1)
-                       self.nextthink = time + WEP_CVAR_SEC(mortar, lifetime_bounce);
+               if(WEP_CVAR_SEC(mortar, lifetime_bounce) && this.gl_bouncecnt == 1)
+                       this.nextthink = time + WEP_CVAR_SEC(mortar, lifetime_bounce);
 
        }
        else if(WEP_CVAR_SEC(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
 
        }
        else if(WEP_CVAR_SEC(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
-               spamsound(self, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
+               spamsound(this, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
 
                // let it stick whereever it is
 
                // let it stick whereever it is
-               self.oldvelocity = self.velocity;
-               self.velocity = '0 0 0';
-               self.movetype = MOVETYPE_NONE; // also disables gravity
-               self.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
-               UpdateCSQCProjectile(self);
+               this.oldvelocity = this.velocity;
+               this.velocity = '0 0 0';
+               this.movetype = MOVETYPE_NONE; // also disables gravity
+               this.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
+               UpdateCSQCProjectile(this);
 
                // do not respond to any more touches
 
                // do not respond to any more touches
-               self.solid = SOLID_NOT;
+               this.solid = SOLID_NOT;
 
 
-               self.nextthink = min(self.nextthink, time + WEP_CVAR_SEC(mortar, lifetime_stick));
+               this.nextthink = min(this.nextthink, time + WEP_CVAR_SEC(mortar, lifetime_stick));
        }
 }
 
 void W_Mortar_Attack(Weapon thiswep, entity actor)
        }
 }
 
 void W_Mortar_Attack(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity gren;
 
        entity gren;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(mortar, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(mortar, ammo));
 
 
-       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
+       W_SetupShot_ProjectileSize(actor, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        gren = new(grenade);
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        gren = new(grenade);
-       gren.owner = gren.realowner = self;
+       gren.owner = gren.realowner = actor;
        gren.bot_dodge = true;
        gren.bot_dodgerating = WEP_CVAR_PRI(mortar, damage);
        gren.movetype = MOVETYPE_BOUNCE;
        gren.bot_dodge = true;
        gren.bot_dodgerating = WEP_CVAR_PRI(mortar, damage);
        gren.movetype = MOVETYPE_BOUNCE;
@@ -255,22 +255,22 @@ void W_Mortar_Attack(Weapon thiswep, entity actor)
        else
                CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
 
        else
                CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, gren);
+       MUTATOR_CALLHOOK(EditProjectile, actor, gren);
 }
 
 void W_Mortar_Attack2(Weapon thiswep, entity actor)
 }
 
 void W_Mortar_Attack2(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity gren;
 
        entity gren;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(mortar, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(mortar, ammo));
 
 
-       W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
+       W_SetupShot_ProjectileSize(actor, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        gren = new(grenade);
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        gren = new(grenade);
-       gren.owner = gren.realowner = self;
+       gren.owner = gren.realowner = actor;
        gren.bot_dodge = true;
        gren.bot_dodgerating = WEP_CVAR_SEC(mortar, damage);
        gren.movetype = MOVETYPE_BOUNCE;
        gren.bot_dodge = true;
        gren.bot_dodgerating = WEP_CVAR_SEC(mortar, damage);
        gren.movetype = MOVETYPE_BOUNCE;
@@ -302,30 +302,29 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor)
        else
                CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
 
        else
                CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, gren);
+       MUTATOR_CALLHOOK(EditProjectile, actor, gren);
 }
 
 .float bot_secondary_grenademooth;
 
 METHOD(Mortar, wr_aim, void(entity thiswep, entity actor))
 {
 }
 
 .float bot_secondary_grenademooth;
 
 METHOD(Mortar, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    PHYS_INPUT_BUTTON_ATCK(self) = false;
-    PHYS_INPUT_BUTTON_ATCK2(self) = false;
-    if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
+    PHYS_INPUT_BUTTON_ATCK(actor) = false;
+    PHYS_INPUT_BUTTON_ATCK2(actor) = false;
+    if(actor.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
     {
     {
-        if(bot_aim(self, WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), true))
+        if(bot_aim(actor, WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), true))
         {
         {
-            PHYS_INPUT_BUTTON_ATCK(self) = true;
-            if(random() < 0.01) self.bot_secondary_grenademooth = 1;
+            PHYS_INPUT_BUTTON_ATCK(actor) = true;
+            if(random() < 0.01) actor.bot_secondary_grenademooth = 1;
         }
     }
     else
     {
         }
     }
     else
     {
-        if(bot_aim(self, WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), true))
+        if(bot_aim(actor, WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), true))
         {
         {
-            PHYS_INPUT_BUTTON_ATCK2(self) = true;
-            if(random() < 0.02) self.bot_secondary_grenademooth = 0;
+            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
+            if(random() < 0.02) actor.bot_secondary_grenademooth = 0;
         }
     }
 }
         }
     }
 }
@@ -417,12 +416,11 @@ METHOD(Mortar, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Mortar, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Mortar, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     vector org2;
     org2 = w_org + w_backoff * 12;
     pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM);
+        sound(actor, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM);
 }
 
 #endif
 }
 
 #endif
index ac9f759fc75954fd3988ae334ffeafcb03775f2c..10c2bd7a9ea288f58059ceb25cab722e1118c0c4 100644 (file)
@@ -55,14 +55,14 @@ MUTATOR_HOOKFUNCTION(porto_ticker, SV_StartFrame) {
 
 void W_Porto_Success(entity this)
 {
 
 void W_Porto_Success(entity this)
 {
-       if(self.realowner == world)
+       if(this.realowner == world)
        {
                objerror("Cannot succeed successfully: no owner\n");
                return;
        }
 
        {
                objerror("Cannot succeed successfully: no owner\n");
                return;
        }
 
-       self.realowner.porto_current = world;
-       remove(self);
+       this.realowner.porto_current = world;
+       remove(this);
 }
 
 string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo);
 }
 
 string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo);
@@ -112,10 +112,10 @@ void W_Porto_Remove(entity p)
 void W_Porto_Think(entity this)
 {
        trace_plane_normal = '0 0 0';
 void W_Porto_Think(entity this)
 {
        trace_plane_normal = '0 0 0';
-       if(self.realowner.playerid != self.playerid)
-               remove(self);
+       if(this.realowner.playerid != this.playerid)
+               remove(this);
        else
        else
-               W_Porto_Fail(self, 0);
+               W_Porto_Fail(this, 0);
 }
 
 void W_Porto_Touch(entity this)
 }
 
 void W_Porto_Touch(entity this)
@@ -131,7 +131,7 @@ void W_Porto_Touch(entity this)
        norm = trace_plane_normal;
        if(trace_ent.iscreature)
        {
        norm = trace_plane_normal;
        if(trace_ent.iscreature)
        {
-               traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * STAT(PL_MIN, NULL).z, MOVE_WORLDONLY, self);
+               traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * STAT(PL_MIN, NULL).z, MOVE_WORLDONLY, this);
                if(trace_fraction >= 1)
                        return;
                if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
                if(trace_fraction >= 1)
                        return;
                if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
@@ -140,121 +140,121 @@ void W_Porto_Touch(entity this)
                        return;
        }
 
                        return;
        }
 
-       if(self.realowner.playerid != self.playerid)
+       if(this.realowner.playerid != this.playerid)
        {
        {
-               sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
-               remove(self);
+               sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
+               remove(this);
        }
        else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
        {
        }
        else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
        {
-               spamsound(self, CH_SHOTS, SND(PORTO_BOUNCE), VOL_BASE, ATTEN_NORM);
+               spamsound(this, CH_SHOTS, SND(PORTO_BOUNCE), VOL_BASE, ATTEN_NORM);
                // just reflect
                // just reflect
-               self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * trace_plane_normal);
-               self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * trace_plane_normal));
+               this.right_vector = this.right_vector - 2 * trace_plane_normal * (this.right_vector * trace_plane_normal);
+               this.angles = vectoangles(this.velocity - 2 * trace_plane_normal * (this.velocity * trace_plane_normal));
        }
        else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        {
        }
        else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        {
-               sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
-               W_Porto_Fail(self, 0);
-               if(self.cnt < 0)
-                       Portal_ClearAll_PortalsOnly(self.realowner);
+               sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
+               W_Porto_Fail(this, 0);
+               if(this.cnt < 0)
+                       Portal_ClearAll_PortalsOnly(this.realowner);
        }
        }
-       else if(self.cnt == 0)
+       else if(this.cnt == 0)
        {
                // in-portal only
        {
                // in-portal only
-               if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
+               if(Portal_SpawnInPortalAtTrace(this.realowner, this.right_vector, this.portal_id))
                {
                {
-                       sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
+                       sound(this, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        trace_plane_normal = norm;
-                       Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN);
-                       W_Porto_Success(self);
+                       Send_Notification(NOTIF_ONE, this.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN);
+                       W_Porto_Success(this);
                }
                else
                {
                }
                else
                {
-                       sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
+                       sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        trace_plane_normal = norm;
-                       W_Porto_Fail(self, 0);
+                       W_Porto_Fail(this, 0);
                }
        }
                }
        }
-       else if(self.cnt == 1)
+       else if(this.cnt == 1)
        {
                // out-portal only
        {
                // out-portal only
-               if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
+               if(Portal_SpawnOutPortalAtTrace(this.realowner, this.right_vector, this.portal_id))
                {
                {
-                       sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
+                       sound(this, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        trace_plane_normal = norm;
-                       Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT);
-                       W_Porto_Success(self);
+                       Send_Notification(NOTIF_ONE, this.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT);
+                       W_Porto_Success(this);
                }
                else
                {
                }
                else
                {
-                       sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
+                       sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        trace_plane_normal = norm;
-                       W_Porto_Fail(self, 0);
+                       W_Porto_Fail(this, 0);
                }
        }
                }
        }
-       else if(self.effects & EF_RED)
+       else if(this.effects & EF_RED)
        {
        {
-               self.effects += EF_BLUE - EF_RED;
-               if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
+               this.effects += EF_BLUE - EF_RED;
+               if(Portal_SpawnInPortalAtTrace(this.realowner, this.right_vector, this.portal_id))
                {
                {
-                       sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
+                       sound(this, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        trace_plane_normal = norm;
-                       Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN);
-                       self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * norm);
-                       self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * norm));
-                       CSQCProjectile(self, true, PROJECTILE_PORTO_BLUE, true); // change type
+                       Send_Notification(NOTIF_ONE, this.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN);
+                       this.right_vector = this.right_vector - 2 * trace_plane_normal * (this.right_vector * norm);
+                       this.angles = vectoangles(this.velocity - 2 * trace_plane_normal * (this.velocity * norm));
+                       CSQCProjectile(this, true, PROJECTILE_PORTO_BLUE, true); // change type
                }
                else
                {
                }
                else
                {
-                       sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
+                       sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        trace_plane_normal = norm;
-                       Portal_ClearAll_PortalsOnly(self.realowner);
-                       W_Porto_Fail(self, 0);
+                       Portal_ClearAll_PortalsOnly(this.realowner);
+                       W_Porto_Fail(this, 0);
                }
        }
        else
        {
                }
        }
        else
        {
-               if(self.realowner.portal_in.portal_id == self.portal_id)
+               if(this.realowner.portal_in.portal_id == this.portal_id)
                {
                {
-                       if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
+                       if(Portal_SpawnOutPortalAtTrace(this.realowner, this.right_vector, this.portal_id))
                        {
                        {
-                               sound(self, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
+                               sound(this, CH_SHOTS, SND_PORTO_CREATE, VOL_BASE, ATTEN_NORM);
                                trace_plane_normal = norm;
                                trace_plane_normal = norm;
-                               Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT);
-                               W_Porto_Success(self);
+                               Send_Notification(NOTIF_ONE, this.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT);
+                               W_Porto_Success(this);
                        }
                        else
                        {
                        }
                        else
                        {
-                               sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
-                               Portal_ClearAll_PortalsOnly(self.realowner);
-                               W_Porto_Fail(self, 0);
+                               sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
+                               Portal_ClearAll_PortalsOnly(this.realowner);
+                               W_Porto_Fail(this, 0);
                        }
                }
                else
                {
                        }
                }
                else
                {
-                       sound(self, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
-                       Portal_ClearAll_PortalsOnly(self.realowner);
-                       W_Porto_Fail(self, 0);
+                       sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
+                       Portal_ClearAll_PortalsOnly(this.realowner);
+                       W_Porto_Fail(this, 0);
                }
        }
 }
 
 void W_Porto_Attack(entity actor, float type)
                }
        }
 }
 
 void W_Porto_Attack(entity actor, float type)
-{entity this = actor;
+{
        entity gren;
 
        entity gren;
 
-       W_SetupShot(self, false, 4, SND_PORTO_FIRE, CH_WEAPON_A, 0);
+       W_SetupShot(actor, false, 4, SND_PORTO_FIRE, CH_WEAPON_A, 0);
        // always shoot from the eye
        w_shotdir = v_forward;
        // always shoot from the eye
        w_shotdir = v_forward;
-       w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
+       w_shotorg = actor.origin + actor.view_ofs + ((w_shotorg - actor.origin - actor.view_ofs) * v_forward) * v_forward;
 
        //Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        gren = new(porto);
        gren.cnt = type;
 
        //Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        gren = new(porto);
        gren.cnt = type;
-       gren.owner = gren.realowner = self;
-       gren.playerid = self.playerid;
+       gren.owner = gren.realowner = actor;
+       gren.playerid = actor.playerid;
        gren.bot_dodge = true;
        gren.bot_dodgerating = 200;
        gren.movetype = MOVETYPE_BOUNCEMISSILE;
        gren.bot_dodge = true;
        gren.bot_dodgerating = 200;
        gren.movetype = MOVETYPE_BOUNCEMISSILE;
@@ -268,7 +268,7 @@ void W_Porto_Attack(entity actor, float type)
        setthink(gren, W_Porto_Think);
        settouch(gren, W_Porto_Touch);
 
        setthink(gren, W_Porto_Think);
        settouch(gren, W_Porto_Touch);
 
-       if(self.items & ITEM_Strength.m_itemid)
+       if(actor.items & ITEM_Strength.m_itemid)
                W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0);
        else
                W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed), 0);
                W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0);
        else
                W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed), 0);
@@ -277,8 +277,8 @@ void W_Porto_Attack(entity actor, float type)
        gren.flags = FL_PROJECTILE;
 
        gren.portal_id = time;
        gren.flags = FL_PROJECTILE;
 
        gren.portal_id = time;
-       self.porto_current = gren;
-       gren.playerid = self.playerid;
+       actor.porto_current = gren;
+       gren.playerid = actor.playerid;
        fixedmakevectors(fixedvectoangles(gren.velocity));
        gren.right_vector = v_right;
 
        fixedmakevectors(fixedvectoangles(gren.velocity));
        gren.right_vector = v_right;
 
@@ -289,17 +289,16 @@ void W_Porto_Attack(entity actor, float type)
        else
                CSQCProjectile(gren, true, PROJECTILE_PORTO_RED, true);
 
        else
                CSQCProjectile(gren, true, PROJECTILE_PORTO_RED, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, gren);
+       MUTATOR_CALLHOOK(EditProjectile, actor, gren);
 }
 
 METHOD(PortoLaunch, wr_aim, void(entity thiswep, entity actor))
 {
 }
 
 METHOD(PortoLaunch, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    PHYS_INPUT_BUTTON_ATCK(self) = false;
-    PHYS_INPUT_BUTTON_ATCK2(self) = false;
+    PHYS_INPUT_BUTTON_ATCK(actor) = false;
+    PHYS_INPUT_BUTTON_ATCK2(actor) = false;
     if(!WEP_CVAR(porto, secondary))
     if(!WEP_CVAR(porto, secondary))
-        if(bot_aim(self, WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
-            PHYS_INPUT_BUTTON_ATCK(self) = true;
+        if(bot_aim(actor, WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
+            PHYS_INPUT_BUTTON_ATCK(actor) = true;
 }
 METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -369,13 +368,11 @@ METHOD(PortoLaunch, wr_checkammo2, bool(entity thiswep, entity this))
 }
 METHOD(PortoLaunch, wr_setup, void(entity thiswep, entity actor))
 {
 }
 METHOD(PortoLaunch, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.ammo_field = ammo_none;
+    actor.ammo_field = ammo_none;
 }
 METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.porto_current = world;
+    actor.porto_current = world;
 }
 #endif
 #ifdef CSQC
 }
 #endif
 #ifdef CSQC
index 7381172aacf48bdfd0bf19e95638bf08280ab0ac..13e44531029ae8b1c47d7adb2146a8e238653a67 100644 (file)
@@ -57,26 +57,26 @@ spawnfunc(weapon_campingrifle) { spawnfunc_weapon_rifle(this); }
 spawnfunc(weapon_sniperrifle) { spawnfunc_weapon_rifle(this); }
 
 void W_Rifle_FireBullet(Weapon thiswep, float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, Sound pSound, entity actor)
 spawnfunc(weapon_sniperrifle) { spawnfunc_weapon_rifle(this); }
 
 void W_Rifle_FireBullet(Weapon thiswep, float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, Sound pSound, entity actor)
-{entity this = actor;
+{
        float i;
 
        float i;
 
-       W_DecreaseAmmo(thiswep, self, pAmmo);
+       W_DecreaseAmmo(thiswep, actor, pAmmo);
 
 
-       W_SetupShot(self, true, 2, pSound, CH_WEAPON_A, pDamage * pShots);
+       W_SetupShot(actor, true, 2, pSound, CH_WEAPON_A, pDamage * pShots);
 
        Send_Effect(EFFECT_RIFLE_MUZZLEFLASH, w_shotorg, w_shotdir * 2000, 1);
 
 
        Send_Effect(EFFECT_RIFLE_MUZZLEFLASH, w_shotorg, w_shotdir * 2000, 1);
 
-       if(PHYS_INPUT_BUTTON_ZOOM(self) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(self)) // if zoomed, shoot from the eye
+       if(PHYS_INPUT_BUTTON_ZOOM(actor) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(actor)) // if zoomed, shoot from the eye
        {
                w_shotdir = v_forward;
        {
                w_shotdir = v_forward;
-               w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
+               w_shotorg = actor.origin + actor.view_ofs + ((w_shotorg - actor.origin - actor.view_ofs) * v_forward) * v_forward;
        }
 
        for(i = 0; i < pShots; ++i)
        }
 
        for(i = 0; i < pShots; ++i)
-               fireBullet(self, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
+               fireBullet(actor, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
 
        if(autocvar_g_casings >= 2)
 
        if(autocvar_g_casings >= 2)
-               SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
+               SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, actor);
 }
 
 void W_Rifle_Attack(entity actor)
 }
 
 void W_Rifle_Attack(entity actor)
@@ -117,22 +117,22 @@ void W_Rifle_BulletHail_Continue(Weapon thiswep, entity actor, .entity weaponent
 }
 
 void W_Rifle_BulletHail(entity actor, .entity weaponentity, float mode, void(entity actor) AttackFunc, WFRAME fr, float animtime, float refire)
 }
 
 void W_Rifle_BulletHail(entity actor, .entity weaponentity, float mode, void(entity actor) AttackFunc, WFRAME fr, float animtime, float refire)
-{entity this = actor;
+{
        // if we get here, we have at least one bullet to fire
        AttackFunc(actor);
        if(mode)
        {
                // continue hail
        // if we get here, we have at least one bullet to fire
        AttackFunc(actor);
        if(mode)
        {
                // continue hail
-               self.rifle_bullethail_attackfunc = AttackFunc;
-               self.rifle_bullethail_frame = fr;
-               self.rifle_bullethail_animtime = animtime;
-               self.rifle_bullethail_refire = refire;
-               weapon_thinkf(self, weaponentity, fr, animtime, W_Rifle_BulletHail_Continue);
+               actor.rifle_bullethail_attackfunc = AttackFunc;
+               actor.rifle_bullethail_frame = fr;
+               actor.rifle_bullethail_animtime = animtime;
+               actor.rifle_bullethail_refire = refire;
+               weapon_thinkf(actor, weaponentity, fr, animtime, W_Rifle_BulletHail_Continue);
        }
        else
        {
                // just one shot
        }
        else
        {
                // just one shot
-               weapon_thinkf(self, weaponentity, fr, animtime, w_ready);
+               weapon_thinkf(actor, weaponentity, fr, animtime, w_ready);
        }
 }
 
        }
 }
 
@@ -140,25 +140,24 @@ void W_Rifle_BulletHail(entity actor, .entity weaponentity, float mode, void(ent
 
 METHOD(Rifle, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(Rifle, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    PHYS_INPUT_BUTTON_ATCK(self) = false;
-    PHYS_INPUT_BUTTON_ATCK2(self) = false;
-    if(vdist(self.origin - self.enemy.origin, >, 1000))
-        self.bot_secondary_riflemooth = 0;
-    if(self.bot_secondary_riflemooth == 0)
+    PHYS_INPUT_BUTTON_ATCK(actor) = false;
+    PHYS_INPUT_BUTTON_ATCK2(actor) = false;
+    if(vdist(actor.origin - actor.enemy.origin, >, 1000))
+        actor.bot_secondary_riflemooth = 0;
+    if(actor.bot_secondary_riflemooth == 0)
     {
     {
-        if(bot_aim(self, 1000000, 0, 0.001, false))
+        if(bot_aim(actor, 1000000, 0, 0.001, false))
         {
         {
-            PHYS_INPUT_BUTTON_ATCK(self) = true;
-            if(random() < 0.01) self.bot_secondary_riflemooth = 1;
+            PHYS_INPUT_BUTTON_ATCK(actor) = true;
+            if(random() < 0.01) actor.bot_secondary_riflemooth = 1;
         }
     }
     else
     {
         }
     }
     else
     {
-        if(bot_aim(self, 1000000, 0, 0.001, false))
+        if(bot_aim(actor, 1000000, 0, 0.001, false))
         {
         {
-            PHYS_INPUT_BUTTON_ATCK2(self) = true;
-            if(random() < 0.03) self.bot_secondary_riflemooth = 0;
+            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
+            if(random() < 0.03) actor.bot_secondary_riflemooth = 0;
         }
     }
 }
         }
     }
 }
@@ -211,8 +210,7 @@ METHOD(Rifle, wr_checkammo2, bool(entity thiswep, entity actor))
 }
 METHOD(Rifle, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Rifle, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.rifle_accumulator = time - WEP_CVAR(rifle, bursttime);
+    actor.rifle_accumulator = time - WEP_CVAR(rifle, bursttime);
 }
 METHOD(Rifle, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
 }
 METHOD(Rifle, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
@@ -245,13 +243,12 @@ METHOD(Rifle, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Rifle, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Rifle, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
     {
     vector org2;
     org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
     {
-        sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
+        sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
     }
 }
 METHOD(Rifle, wr_init, void(entity thiswep))
     }
 }
 METHOD(Rifle, wr_init, void(entity thiswep))
index 2fc64252516bb68871e39bd491035c08b6b7f9bd..71c24b59a0335bd67dd52842052dc424b69df66d 100644 (file)
@@ -96,10 +96,10 @@ spawnfunc(weapon_seeker) { weapon_defaultspawnfunc(this, WEP_SEEKER); }
 // ============================
 void W_Seeker_Missile_Explode(entity this)
 {
 // ============================
 void W_Seeker_Missile_Explode(entity this)
 {
-       self.event_damage = func_null;
-       RadiusDamage(self, self.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), self.projectiledeathtype, other);
+       this.event_damage = func_null;
+       RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_Seeker_Missile_Touch(entity this)
 }
 
 void W_Seeker_Missile_Touch(entity this)
@@ -117,50 +117,50 @@ void W_Seeker_Missile_Think(entity this)
        float dist;
        float spd;
 
        float dist;
        float spd;
 
-       if(time > self.cnt)
+       if(time > this.cnt)
        {
        {
-               self.projectiledeathtype |= HITTYPE_SPLASH;
-               W_Seeker_Missile_Explode(self);
+               this.projectiledeathtype |= HITTYPE_SPLASH;
+               W_Seeker_Missile_Explode(this);
        }
 
        }
 
-       spd = vlen(self.velocity);
+       spd = vlen(this.velocity);
        spd = bound(
                spd - WEP_CVAR(seeker, missile_decel) * frametime,
                WEP_CVAR(seeker, missile_speed_max),
                spd + WEP_CVAR(seeker, missile_accel) * frametime
        );
 
        spd = bound(
                spd - WEP_CVAR(seeker, missile_decel) * frametime,
                WEP_CVAR(seeker, missile_speed_max),
                spd + WEP_CVAR(seeker, missile_accel) * frametime
        );
 
-       if(self.enemy != world)
-               if(self.enemy.takedamage != DAMAGE_AIM || IS_DEAD(self.enemy))
-                       self.enemy = world;
+       if(this.enemy != world)
+               if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
+                       this.enemy = world;
 
 
-       if(self.enemy != world)
+       if(this.enemy != world)
        {
        {
-               e               = self.enemy;
+               e               = this.enemy;
                eorg            = 0.5 * (e.absmin + e.absmax);
                turnrate        = WEP_CVAR(seeker, missile_turnrate); // how fast to turn
                eorg            = 0.5 * (e.absmin + e.absmax);
                turnrate        = WEP_CVAR(seeker, missile_turnrate); // how fast to turn
-               desireddir      = normalize(eorg - self.origin);
-               olddir          = normalize(self.velocity); // get my current direction
-               dist            = vlen(eorg - self.origin);
+               desireddir      = normalize(eorg - this.origin);
+               olddir          = normalize(this.velocity); // get my current direction
+               dist            = vlen(eorg - this.origin);
 
                // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
                if(WEP_CVAR(seeker, missile_smart) && (dist > WEP_CVAR(seeker, missile_smart_mindist)))
                {
 
                // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
                if(WEP_CVAR(seeker, missile_smart) && (dist > WEP_CVAR(seeker, missile_smart_mindist)))
                {
-                       // Is it a better idea (shorter distance) to trace to the target itself?
-                       if( vdist(self.origin + olddir * self.wait, <, dist))
-                               traceline(self.origin, self.origin + olddir * self.wait, false, self);
+                       // Is it a better idea (shorter distance) to trace to the target itthis?
+                       if( vdist(this.origin + olddir * this.wait, <, dist))
+                               traceline(this.origin, this.origin + olddir * this.wait, false, this);
                        else
                        else
-                               traceline(self.origin, eorg, false, self);
+                               traceline(this.origin, eorg, false, this);
 
                        // Setup adaptive tracelength
 
                        // Setup adaptive tracelength
-                       self.wait = bound(WEP_CVAR(seeker, missile_smart_trace_min), vlen(self.origin - trace_endpos), self.wait = WEP_CVAR(seeker, missile_smart_trace_max));
+                       this.wait = bound(WEP_CVAR(seeker, missile_smart_trace_min), vlen(this.origin - trace_endpos), this.wait = WEP_CVAR(seeker, missile_smart_trace_max));
 
                        // Calc how important it is that we turn and add this to the desierd (enemy) dir.
                        desireddir  = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
                }
 
                newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
 
                        // Calc how important it is that we turn and add this to the desierd (enemy) dir.
                        desireddir  = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
                }
 
                newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
-               self.velocity = newdir * spd; // make me fly in the new direction at my flight speed
+               this.velocity = newdir * spd; // make me fly in the new direction at my flight speed
        }
        else
                dist = 0;
        }
        else
                dist = 0;
@@ -170,38 +170,38 @@ void W_Seeker_Missile_Think(entity this)
        {
                if(dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
                {
        {
                if(dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
                {
-                       if(self.autoswitch == 0)
+                       if(this.autoswitch == 0)
                        {
                        {
-                               self.autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
+                               this.autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
                        }
                        else
                        {
                        }
                        else
                        {
-                               if(self.autoswitch <= time)
+                               if(this.autoswitch <= time)
                                {
                                {
-                                       W_Seeker_Missile_Explode(self);
-                                       self.autoswitch = 0;
+                                       W_Seeker_Missile_Explode(this);
+                                       this.autoswitch = 0;
                                }
                        }
                }
                else
                {
                                }
                        }
                }
                else
                {
-                       if(self.autoswitch != 0)
-                               self.autoswitch = 0;
+                       if(this.autoswitch != 0)
+                               this.autoswitch = 0;
                }
        }
        ///////////////
 
                }
        }
        ///////////////
 
-       if(IS_DEAD(self.enemy))
+       if(IS_DEAD(this.enemy))
        {
        {
-               self.enemy = world;
-               self.cnt = time + 1 + (random() * 4);
-               self.nextthink = self.cnt;
+               this.enemy = world;
+               this.cnt = time + 1 + (random() * 4);
+               this.nextthink = this.cnt;
                return;
        }
 
                return;
        }
 
-       //self.angles = vectoangles(self.velocity);                     // turn model in the new flight direction
-       self.nextthink = time;// + 0.05; // csqc projectiles
-       UpdateCSQCProjectile(self);
+       //this.angles = vectoangles(this.velocity);                     // turn model in the new flight direction
+       this.nextthink = time;// + 0.05; // csqc projectiles
+       UpdateCSQCProjectile(this);
 }
 
 
 }
 
 
@@ -224,45 +224,45 @@ void W_Seeker_Missile_Damage(entity this, entity inflictor, entity attacker, flo
 }
 
 /*
 }
 
 /*
-void W_Seeker_Missile_Animate()
+void W_Seeker_Missile_Animate(entity this)
 {
 {
-       self.frame = self.frame +1;
-       self.nextthink = time + 0.05;
+       this.frame = this.frame +1;
+       this.nextthink = time + 0.05;
 
 
-       if(self.enemy != world)
-               if(self.enemy.takedamage != DAMAGE_AIM || IS_DEAD(self.enemy))
-                       self.enemy = world;
+       if(this.enemy != world)
+               if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
+                       this.enemy = world;
 
 
-       if(self.frame == 5)
+       if(this.frame == 5)
        {
        {
-               self.think           = W_Seeker_Missile_Think;
-               self.nextthink       = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
+               this.think           = W_Seeker_Missile_Think;
+               this.nextthink       = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
 
                if(autocvar_g_balance_seeker_missile_proxy)
 
                if(autocvar_g_balance_seeker_missile_proxy)
-                       self.movetype    = MOVETYPE_BOUNCEMISSILE;
+                       this.movetype    = MOVETYPE_BOUNCEMISSILE;
                else
                else
-                       self.movetype    = MOVETYPE_FLYMISSILE;
+                       this.movetype    = MOVETYPE_FLYMISSILE;
        }
 
        }
 
-       UpdateCSQCProjectile(self);
+       UpdateCSQCProjectile(this);
 }
 */
 
 void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m_target)
 }
 */
 
 void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m_target)
-{entity this = actor;
+{
        entity missile;
 
        entity missile;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR(seeker, missile_ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, missile_ammo));
 
 
-       makevectors(self.v_angle);
-       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0);
+       makevectors(actor.v_angle);
+       W_SetupShot_ProjectileSize(actor, '-2 -2 -2', '2 2 2', false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0);
        w_shotorg += f_diff;
        Send_Effect(EFFECT_SEEKER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        w_shotorg += f_diff;
        Send_Effect(EFFECT_SEEKER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
-       //self.detornator         = false;
+       //actor.detornator         = false;
 
        missile                 = new(seeker_missile);
 
        missile                 = new(seeker_missile);
-       missile.owner           = missile.realowner = self;
+       missile.owner           = missile.realowner = actor;
        missile.bot_dodge       = true;
        missile.bot_dodgerating = WEP_CVAR(seeker, missile_damage);
 
        missile.bot_dodge       = true;
        missile.bot_dodgerating = WEP_CVAR(seeker, missile_damage);
 
@@ -298,7 +298,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m
 
        CSQCProjectile(missile, false, PROJECTILE_SEEKER, true);
 
 
        CSQCProjectile(missile, false, PROJECTILE_SEEKER, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 // ============================
 }
 
 // ============================
@@ -306,11 +306,11 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m
 // ============================
 void W_Seeker_Flac_Explode(entity this)
 {
 // ============================
 void W_Seeker_Flac_Explode(entity this)
 {
-       self.event_damage = func_null;
+       this.event_damage = func_null;
 
 
-       RadiusDamage(self, self.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), self.projectiledeathtype, other);
+       RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, other);
 
 
-       remove(self);
+       remove(this);
 }
 
 void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
@@ -319,14 +319,14 @@ void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_Seeker_Fire_Flac(Weapon thiswep, entity actor)
 }
 
 void W_Seeker_Fire_Flac(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity missile;
        vector f_diff;
        float c;
 
        entity missile;
        vector f_diff;
        float c;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR(seeker, flac_ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, flac_ammo));
 
 
-       c = self.bulletcounter % 4;
+       c = actor.bulletcounter % 4;
        switch(c)
        {
                case 0:
        switch(c)
        {
                case 0:
@@ -343,13 +343,13 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor)
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
+       W_SetupShot_ProjectileSize(actor, '-2 -2 -2', '2 2 2', false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
        w_shotorg += f_diff;
 
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile                                 = new(missile);
        w_shotorg += f_diff;
 
        Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        missile                                 = new(missile);
-       missile.owner                   = missile.realowner = self;
+       missile.owner                   = missile.realowner = actor;
        missile.bot_dodge               = true;
        missile.bot_dodgerating = WEP_CVAR(seeker, flac_damage);
        settouch(missile, W_Seeker_Flac_Explode);
        missile.bot_dodge               = true;
        missile.bot_dodgerating = WEP_CVAR(seeker, flac_damage);
        settouch(missile, W_Seeker_Flac_Explode);
@@ -373,7 +373,7 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor)
        W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
        CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
 
        W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
        CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 // ============================
 }
 
 // ============================
@@ -390,22 +390,22 @@ entity W_Seeker_Tagged_Info(entity isowner, entity istarget)
 }
 
 void W_Seeker_Attack(entity actor)
 }
 
 void W_Seeker_Attack(entity actor)
-{entity this = actor;
+{
        entity tracker, closest_target;
 
        closest_target = world;
        entity tracker, closest_target;
 
        closest_target = world;
-       for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self)
+       for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == actor)
        {
                if(closest_target)
                {
        {
                if(closest_target)
                {
-                       if(vlen2(self.origin - tracker.tag_target.origin) < vlen2(self.origin - closest_target.origin))
+                       if(vlen2(actor.origin - tracker.tag_target.origin) < vlen2(actor.origin - closest_target.origin))
                                closest_target = tracker.tag_target;
                }
                else
                        closest_target = tracker.tag_target;
        }
 
                                closest_target = tracker.tag_target;
                }
                else
                        closest_target = tracker.tag_target;
        }
 
-       traceline(self.origin + self.view_ofs, closest_target.origin, MOVE_NOMONSTERS, self);
+       traceline(actor.origin + actor.view_ofs, closest_target.origin, MOVE_NOMONSTERS, actor);
        if((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
                closest_target = world;
 
        if((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
                closest_target = world;
 
@@ -456,19 +456,19 @@ void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seek
 void W_Seeker_Tracker_Think(entity this)
 {
        // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
 void W_Seeker_Tracker_Think(entity this)
 {
        // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
-       if((IS_DEAD(self.realowner)) || (IS_DEAD(self.tag_target)) || (PS(self.realowner).m_switchweapon != WEP_SEEKER)
-       || (time > self.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
+       if((IS_DEAD(this.realowner)) || (IS_DEAD(this.tag_target)) || (PS(this.realowner).m_switchweapon != WEP_SEEKER)
+       || (time > this.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
        {
        {
-               if(self)
+               if(this)
                {
                {
-                       WaypointSprite_Kill(self.tag_target.wps_tag_tracker);
-                       remove(self);
+                       WaypointSprite_Kill(this.tag_target.wps_tag_tracker);
+                       remove(this);
                }
                return;
        }
 
        // Update the think method information
                }
                return;
        }
 
        // Update the think method information
-       self.nextthink = time;
+       this.nextthink = time;
 }
 
 // ============================
 }
 
 // ============================
@@ -500,18 +500,18 @@ void W_Seeker_Tag_Touch(entity this)
 
        PROJECTILE_TOUCH(this);
 
 
        PROJECTILE_TOUCH(this);
 
-       dir     = normalize(self.realowner.origin - self.origin);
-       org2    = findbetterlocation(self.origin, 8);
+       dir     = normalize(this.realowner.origin - this.origin);
+       org2    = findbetterlocation(this.origin, 8);
 
        te_knightspike(org2);
 
 
        te_knightspike(org2);
 
-       self.event_damage = func_null;
-       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY, other.species, self);
+       this.event_damage = func_null;
+       Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY, other.species, this);
 
        if(other.takedamage == DAMAGE_AIM && !IS_DEAD(other))
        {
                // check to see if this person is already tagged by me
 
        if(other.takedamage == DAMAGE_AIM && !IS_DEAD(other))
        {
                // check to see if this person is already tagged by me
-               entity tag = W_Seeker_Tagged_Info(self.realowner, other);
+               entity tag = W_Seeker_Tagged_Info(this.realowner, other);
 
                if(tag != world)
                {
 
                if(tag != world)
                {
@@ -522,11 +522,11 @@ void W_Seeker_Tag_Touch(entity this)
                }
                else
                {
                }
                else
                {
-                       //sprint(self.realowner, strcat("You just tagged ^2", other.netname, "^7 with a tracking device!\n"));
+                       //sprint(this.realowner, strcat("You just tagged ^2", other.netname, "^7 with a tracking device!\n"));
                        e             = new(tag_tracker);
                        e.cnt         = WEP_CVAR(seeker, missile_count);
                        e             = new(tag_tracker);
                        e.cnt         = WEP_CVAR(seeker, missile_count);
-                       e.owner       = self.owner;
-                       e.realowner   = self.realowner;
+                       e.owner       = this.owner;
+                       e.realowner   = this.realowner;
 
                        if(WEP_CVAR(seeker, type) == 1)
                        {
 
                        if(WEP_CVAR(seeker, type) == 1)
                        {
@@ -545,24 +545,24 @@ void W_Seeker_Tag_Touch(entity this)
 
                if(WEP_CVAR(seeker, type) == 1)
                {
 
                if(WEP_CVAR(seeker, type) == 1)
                {
-                       WaypointSprite_Spawn(WP_Seeker, WEP_CVAR(seeker, tag_tracker_lifetime), 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, true, RADARICON_TAGGED);
+                       WaypointSprite_Spawn(WP_Seeker, WEP_CVAR(seeker, tag_tracker_lifetime), 0, other, '0 0 64', this.realowner, 0, other, wps_tag_tracker, true, RADARICON_TAGGED);
                        WaypointSprite_UpdateRule(other.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
                }
        }
 
                        WaypointSprite_UpdateRule(other.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
                }
        }
 
-       remove(self);
+       remove(this);
        return;
 }
 
 void W_Seeker_Fire_Tag(Weapon thiswep, entity actor)
        return;
 }
 
 void W_Seeker_Fire_Tag(Weapon thiswep, entity actor)
-{entity this = actor;
+{
        entity missile;
        entity missile;
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR(seeker, tag_ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, tag_ammo));
 
 
-       W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
+       W_SetupShot_ProjectileSize(actor, '-2 -2 -2', '2 2 2', false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
 
        missile                 = new(seeker_tag);
 
        missile                 = new(seeker_tag);
-       missile.owner           = missile.realowner = self;
+       missile.owner           = missile.realowner = actor;
        missile.bot_dodge       = true;
        missile.bot_dodgerating = 50;
        settouch(missile, W_Seeker_Tag_Touch);
        missile.bot_dodge       = true;
        missile.bot_dodgerating = 50;
        settouch(missile, W_Seeker_Tag_Touch);
@@ -588,7 +588,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor)
 
        CSQCProjectile(missile, true, PROJECTILE_TAG, false); // has sound
 
 
        CSQCProjectile(missile, true, PROJECTILE_TAG, false); // has sound
 
-       MUTATOR_CALLHOOK(EditProjectile, self, missile);
+       MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 }
 
 // ============================
 }
 
 // ============================
@@ -597,14 +597,13 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor)
 
 METHOD(Seeker, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(Seeker, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     if(WEP_CVAR(seeker, type) == 1)
     if(WEP_CVAR(seeker, type) == 1)
-        if(W_Seeker_Tagged_Info(self, self.enemy) != world)
-            PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
+        if(W_Seeker_Tagged_Info(actor, actor.enemy) != world)
+            PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
         else
         else
-            PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+            PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
     else
     else
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
 }
 METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -701,7 +700,6 @@ METHOD(Seeker, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2;
     org2 = w_org + w_backoff * 6;
     if(w_deathtype & HITTYPE_BOUNCE)
     vector org2;
     org2 = w_org + w_backoff * 6;
     if(w_deathtype & HITTYPE_BOUNCE)
@@ -709,7 +707,7 @@ METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
         if(w_deathtype & HITTYPE_SECONDARY)
         {
             if(!w_issilent)
         if(w_deathtype & HITTYPE_SECONDARY)
         {
             if(!w_issilent)
-                sound(self, CH_SHOTS, SND_TAG_IMPACT, 1, ATTEN_NORM);
+                sound(actor, CH_SHOTS, SND_TAG_IMPACT, 1, ATTEN_NORM);
         }
         else
         {
         }
         else
         {
@@ -717,11 +715,11 @@ METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
             if(!w_issilent)
             {
                 if(w_random<0.15)
             if(!w_issilent)
             {
                 if(w_random<0.15)
-                    sound(self, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM);
+                    sound(actor, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM);
                 else if(w_random<0.7)
                 else if(w_random<0.7)
-                    sound(self, CH_SHOTS, SND_TAGEXP2, 1, ATTEN_NORM);
+                    sound(actor, CH_SHOTS, SND_TAGEXP2, 1, ATTEN_NORM);
                 else
                 else
-                    sound(self, CH_SHOTS, SND_TAGEXP3, 1, ATTEN_NORM);
+                    sound(actor, CH_SHOTS, SND_TAGEXP3, 1, ATTEN_NORM);
             }
         }
     }
             }
         }
     }
@@ -731,11 +729,11 @@ METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
         if(!w_issilent)
         {
             if(w_random<0.15)
         if(!w_issilent)
         {
             if(w_random<0.15)
-                sound(self, CH_SHOTS, SND_SEEKEREXP1, 1, ATTEN_NORM);
+                sound(actor, CH_SHOTS, SND_SEEKEREXP1, 1, ATTEN_NORM);
             else if(w_random<0.7)
             else if(w_random<0.7)
-                sound(self, CH_SHOTS, SND_SEEKEREXP2, 1, ATTEN_NORM);
+                sound(actor, CH_SHOTS, SND_SEEKEREXP2, 1, ATTEN_NORM);
             else
             else
-                sound(self, CH_SHOTS, SND_SEEKEREXP3, 1, ATTEN_NORM);
+                sound(actor, CH_SHOTS, SND_SEEKEREXP3, 1, ATTEN_NORM);
         }
     }
 }
         }
     }
 }
index a138d6a68e6da870d9a511667d91279d2b161805..9834dab6ba62bf3554eb045b4746c32c6d960e95 100644 (file)
@@ -93,7 +93,7 @@ spawnfunc(weapon_shockwave)
 {
        //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
        if(autocvar_sv_q3acompat_machineshotgunswap)
 {
        //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
        if(autocvar_sv_q3acompat_machineshotgunswap)
-       if(self.classname != "droppedweapon")
+       if(this.classname != "droppedweapon")
        {
                weapon_defaultspawnfunc(this, WEP_MACHINEGUN);
                return;
        {
                weapon_defaultspawnfunc(this, WEP_MACHINEGUN);
                return;
@@ -120,57 +120,57 @@ void W_Shockwave_Melee_Think(entity this)
        vector targpos;
 
        // check to see if we can still continue, otherwise give up now
        vector targpos;
 
        // check to see if we can still continue, otherwise give up now
-       if(IS_DEAD(self.realowner) && WEP_CVAR(shockwave, melee_no_doubleslap))
+       if(IS_DEAD(this.realowner) && WEP_CVAR(shockwave, melee_no_doubleslap))
        {
        {
-               remove(self);
+               remove(this);
                return;
        }
 
        // set start time of melee
                return;
        }
 
        // set start time of melee
-       if(!self.cnt)
+       if(!this.cnt)
        {
        {
-               self.cnt = time;
-               W_PlayStrengthSound(self.realowner);
+               this.cnt = time;
+               W_PlayStrengthSound(this.realowner);
        }
 
        // update values for v_* vectors
        }
 
        // update values for v_* vectors
-       makevectors(self.realowner.v_angle);
+       makevectors(this.realowner.v_angle);
 
        // calculate swing percentage based on time
        meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor(this.realowner);
 
        // calculate swing percentage based on time
        meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor(this.realowner);
-       swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
+       swing = bound(0, (this.cnt + meleetime - time) / meleetime, 10);
        f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces));
 
        // perform the traces needed for this frame
        f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces));
 
        // perform the traces needed for this frame
-       for(i=self.swing_prev; i < f; ++i)
+       for(i=this.swing_prev; i < f; ++i)
        {
                swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1);
 
        {
                swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1);
 
-               targpos = (self.realowner.origin + self.realowner.view_ofs
+               targpos = (this.realowner.origin + this.realowner.view_ofs
                        + (v_forward * WEP_CVAR(shockwave, melee_range))
                        + (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up))
                        + (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side)));
 
                WarpZone_traceline_antilag(
                        + (v_forward * WEP_CVAR(shockwave, melee_range))
                        + (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up))
                        + (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side)));
 
                WarpZone_traceline_antilag(
-                       self.realowner,
-                       (self.realowner.origin + self.realowner.view_ofs),
+                       this.realowner,
+                       (this.realowner.origin + this.realowner.view_ofs),
                        targpos,
                        false,
                        targpos,
                        false,
-                       self.realowner,
-                       ANTILAG_LATENCY(self.realowner)
+                       this.realowner,
+                       ANTILAG_LATENCY(this.realowner)
                );
 
                // draw lightning beams for debugging
 #ifdef DEBUG_SHOCKWAVE
                );
 
                // draw lightning beams for debugging
 #ifdef DEBUG_SHOCKWAVE
-               te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
+               te_lightning2(world, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
                te_customflash(targpos, 40,  2, '1 1 1');
 #endif
 
                is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
 
                te_customflash(targpos, 40,  2, '1 1 1');
 #endif
 
                is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
 
-               if((trace_fraction < 1) // if trace is good, apply the damage and remove self if necessary
+               if((trace_fraction < 1) // if trace is good, apply the damage and remove this if necessary
                        && (trace_ent.takedamage == DAMAGE_AIM)
                        && (trace_ent.takedamage == DAMAGE_AIM)
-                       && (trace_ent != self.swing_alreadyhit)
+                       && (trace_ent != this.swing_alreadyhit)
                        && (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage)))
                {
                        target_victim = trace_ent; // so it persists through other calls
                        && (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage)))
                {
                        target_victim = trace_ent; // so it persists through other calls
@@ -183,22 +183,22 @@ void W_Shockwave_Melee_Think(entity this)
                        // trigger damage with this calculated info
                        Damage(
                                target_victim,
                        // trigger damage with this calculated info
                        Damage(
                                target_victim,
-                               self.realowner,
-                               self.realowner,
+                               this.realowner,
+                               this.realowner,
                                swing_damage,
                                (WEP_SHOCKWAVE.m_id | HITTYPE_SECONDARY),
                                swing_damage,
                                (WEP_SHOCKWAVE.m_id | HITTYPE_SECONDARY),
-                               (self.realowner.origin + self.realowner.view_ofs),
+                               (this.realowner.origin + this.realowner.view_ofs),
                                (v_forward * WEP_CVAR(shockwave, melee_force))
                        );
 
                        // handle accuracy
                                (v_forward * WEP_CVAR(shockwave, melee_force))
                        );
 
                        // handle accuracy
-                       if(accuracy_isgooddamage(self.realowner, target_victim))
-                               { accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
+                       if(accuracy_isgooddamage(this.realowner, target_victim))
+                               { accuracy_add(this.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
 
                        #ifdef DEBUG_SHOCKWAVE
                        LOG_INFO(sprintf(
                                "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
 
                        #ifdef DEBUG_SHOCKWAVE
                        LOG_INFO(sprintf(
                                "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
-                               self.realowner.netname,
+                               this.realowner.netname,
                                target_victim.netname,
                                swing_damage,
                                swing_factor,
                                target_victim.netname,
                                swing_damage,
                                swing_factor,
@@ -209,28 +209,28 @@ void W_Shockwave_Melee_Think(entity this)
                        // allow multiple hits with one swing, but not against the same player twice
                        if(WEP_CVAR(shockwave, melee_multihit))
                        {
                        // allow multiple hits with one swing, but not against the same player twice
                        if(WEP_CVAR(shockwave, melee_multihit))
                        {
-                               self.swing_alreadyhit = target_victim;
+                               this.swing_alreadyhit = target_victim;
                                continue; // move along to next trace
                        }
                        else
                        {
                                continue; // move along to next trace
                        }
                        else
                        {
-                               remove(self);
+                               remove(this);
                                return;
                        }
                }
        }
 
                                return;
                        }
                }
        }
 
-       if(time >= self.cnt + meleetime)
+       if(time >= this.cnt + meleetime)
        {
                // melee is finished
        {
                // melee is finished
-               remove(self);
+               remove(this);
                return;
        }
        else
        {
                // set up next frame
                return;
        }
        else
        {
                // set up next frame
-               self.swing_prev = i;
-               self.nextthink = time;
+               this.swing_prev = i;
+               this.nextthink = time;
        }
 }
 
        }
 }
 
@@ -281,7 +281,7 @@ float W_Shockwave_Attack_IsVisible(
        vector nearest_on_line,
        vector sw_shotorg,
        vector attack_endpos)
        vector nearest_on_line,
        vector sw_shotorg,
        vector attack_endpos)
-{entity this = actor;
+{
        vector nearest_to_attacker = head.WarpZone_findradius_nearest;
        vector center = (head.origin + (head.mins + head.maxs) * 0.5);
        vector corner;
        vector nearest_to_attacker = head.WarpZone_findradius_nearest;
        vector center = (head.origin + (head.mins + head.maxs) * 0.5);
        vector corner;
@@ -290,14 +290,14 @@ float W_Shockwave_Attack_IsVisible(
        // STEP ONE: Check if the nearest point is clear
        if(W_Shockwave_Attack_CheckSpread(nearest_to_attacker, nearest_on_line, sw_shotorg, attack_endpos))
        {
        // STEP ONE: Check if the nearest point is clear
        if(W_Shockwave_Attack_CheckSpread(nearest_to_attacker, nearest_on_line, sw_shotorg, attack_endpos))
        {
-               WarpZone_TraceLine(sw_shotorg, nearest_to_attacker, MOVE_NOMONSTERS, self);
+               WarpZone_TraceLine(sw_shotorg, nearest_to_attacker, MOVE_NOMONSTERS, actor);
                if(trace_fraction == 1) { return true; } // yes, the nearest point is clear and we can allow the damage
        }
 
        // STEP TWO: Check if shotorg to center point is clear
        if(W_Shockwave_Attack_CheckSpread(center, nearest_on_line, sw_shotorg, attack_endpos))
        {
                if(trace_fraction == 1) { return true; } // yes, the nearest point is clear and we can allow the damage
        }
 
        // STEP TWO: Check if shotorg to center point is clear
        if(W_Shockwave_Attack_CheckSpread(center, nearest_on_line, sw_shotorg, attack_endpos))
        {
-               WarpZone_TraceLine(sw_shotorg, center, MOVE_NOMONSTERS, self);
+               WarpZone_TraceLine(sw_shotorg, center, MOVE_NOMONSTERS, actor);
                if(trace_fraction == 1) { return true; } // yes, the center point is clear and we can allow the damage
        }
 
                if(trace_fraction == 1) { return true; } // yes, the center point is clear and we can allow the damage
        }
 
@@ -307,7 +307,7 @@ float W_Shockwave_Attack_IsVisible(
                corner = get_corner_position(head, i);
                if(W_Shockwave_Attack_CheckSpread(corner, nearest_on_line, sw_shotorg, attack_endpos))
                {
                corner = get_corner_position(head, i);
                if(W_Shockwave_Attack_CheckSpread(corner, nearest_on_line, sw_shotorg, attack_endpos))
                {
-                       WarpZone_TraceLine(sw_shotorg, corner, MOVE_NOMONSTERS, self);
+                       WarpZone_TraceLine(sw_shotorg, corner, MOVE_NOMONSTERS, actor);
                        if(trace_fraction == 1) { return true; } // yes, this corner is clear and we can allow the damage
                }
        }
                        if(trace_fraction == 1) { return true; } // yes, this corner is clear and we can allow the damage
                }
        }
@@ -356,7 +356,7 @@ void W_Shockwave_Send(entity actor)
 }
 
 void W_Shockwave_Attack(entity actor)
 }
 
 void W_Shockwave_Attack(entity actor)
-{entity this = actor;
+{
        // declarations
        float multiplier, multiplier_from_accuracy, multiplier_from_distance;
        float final_damage;
        // declarations
        float multiplier, multiplier_from_accuracy, multiplier_from_distance;
        float final_damage;
@@ -366,16 +366,16 @@ void W_Shockwave_Attack(entity actor)
        float i, queue = 0;
 
        // set up the shot direction
        float i, queue = 0;
 
        // set up the shot direction
-       W_SetupShot(self, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
+       W_SetupShot(actor, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
        vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
        vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
-       WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, self);
+       WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, actor);
        vector attack_hitpos = trace_endpos;
        float distance_to_end = vlen(w_shotorg - attack_endpos);
        float distance_to_hit = vlen(w_shotorg - attack_hitpos);
        //entity transform = WarpZone_trace_transform;
 
        // do the firing effect now
        vector attack_hitpos = trace_endpos;
        float distance_to_end = vlen(w_shotorg - attack_endpos);
        float distance_to_hit = vlen(w_shotorg - attack_hitpos);
        //entity transform = WarpZone_trace_transform;
 
        // do the firing effect now
-       W_Shockwave_Send(self);
+       W_Shockwave_Send(actor);
        Damage_DamageInfo(
                attack_hitpos,
                WEP_CVAR(shockwave, blast_splash_damage),
        Damage_DamageInfo(
                attack_hitpos,
                WEP_CVAR(shockwave, blast_splash_damage),
@@ -384,7 +384,7 @@ void W_Shockwave_Attack(entity actor)
                w_shotdir * WEP_CVAR(shockwave, blast_splash_force),
                WEP_SHOCKWAVE.m_id,
                0,
                w_shotdir * WEP_CVAR(shockwave, blast_splash_force),
                WEP_SHOCKWAVE.m_id,
                0,
-               self
+               actor
        );
 
        // splash damage/jumping trace
        );
 
        // splash damage/jumping trace
@@ -403,7 +403,7 @@ void W_Shockwave_Attack(entity actor)
                {
                        float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
 
                {
                        float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
 
-                       if((head == self) && (distance_to_head <= WEP_CVAR(shockwave, blast_jump_radius)))
+                       if((head == actor) && (distance_to_head <= WEP_CVAR(shockwave, blast_jump_radius)))
                        {
                                // ========================
                                //  BLAST JUMP CALCULATION
                        {
                                // ========================
                                //  BLAST JUMP CALCULATION
@@ -459,8 +459,8 @@ void W_Shockwave_Attack(entity actor)
                                // trigger damage with this calculated info
                                Damage(
                                        head,
                                // trigger damage with this calculated info
                                Damage(
                                        head,
-                                       self,
-                                       self,
+                                       actor,
+                                       actor,
                                        final_damage,
                                        WEP_SHOCKWAVE.m_id,
                                        head.origin,
                                        final_damage,
                                        WEP_SHOCKWAVE.m_id,
                                        head.origin,
@@ -550,7 +550,7 @@ void W_Shockwave_Attack(entity actor)
        head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), false);
        while(head)
        {
        head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), false);
        while(head)
        {
-               if((head != self) && head.takedamage)
+               if((head != actor) && head.takedamage)
                {
                        // ========================
                        //  BLAST CONE CALCULATION
                {
                        // ========================
                        //  BLAST CONE CALCULATION
@@ -563,15 +563,15 @@ void W_Shockwave_Attack(entity actor)
                        float h; // hypotenuse, which is the distance between attacker to head
                        float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
 
                        float h; // hypotenuse, which is the distance between attacker to head
                        float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
 
-                       h = vlen(center - self.origin);
-                       a = h * (normalize(center - self.origin) * w_shotdir);
+                       h = vlen(center - actor.origin);
+                       a = h * (normalize(center - actor.origin) * w_shotdir);
                        // WEAPONTODO: replace with simpler method
 
                        vector nearest_on_line = (w_shotorg + a * w_shotdir);
                        vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
 
                        if((vlen(head.WarpZone_findradius_dist) <= WEP_CVAR(shockwave, blast_distance))
                        // WEAPONTODO: replace with simpler method
 
                        vector nearest_on_line = (w_shotorg + a * w_shotdir);
                        vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
 
                        if((vlen(head.WarpZone_findradius_dist) <= WEP_CVAR(shockwave, blast_distance))
-                               && (W_Shockwave_Attack_IsVisible(self, head, nearest_on_line, w_shotorg, attack_endpos)))
+                               && (W_Shockwave_Attack_IsVisible(actor, head, nearest_on_line, w_shotorg, attack_endpos)))
                        {
                                // calculate importance of distance and accuracy for this attack
                                multiplier_from_accuracy = (1 -
                        {
                                // calculate importance of distance and accuracy for this attack
                                multiplier_from_accuracy = (1 -
@@ -643,24 +643,24 @@ void W_Shockwave_Attack(entity actor)
 
                Damage(
                        head,
 
                Damage(
                        head,
-                       self,
-                       self,
+                       actor,
+                       actor,
                        final_damage,
                        WEP_SHOCKWAVE.m_id,
                        head.origin,
                        final_force
                );
 
                        final_damage,
                        WEP_SHOCKWAVE.m_id,
                        head.origin,
                        final_force
                );
 
-               if(accuracy_isgooddamage(self.realowner, head))
+               if(accuracy_isgooddamage(actor.realowner, head))
                {
                        LOG_INFO("wtf\n");
                {
                        LOG_INFO("wtf\n");
-                       accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, final_damage);
+                       accuracy_add(actor.realowner, WEP_SHOCKWAVE.m_id, 0, final_damage);
                }
 
                #ifdef DEBUG_SHOCKWAVE
                LOG_INFO(sprintf(
                        "SHOCKWAVE by %s: damage = %f, force = %f.\n",
                }
 
                #ifdef DEBUG_SHOCKWAVE
                LOG_INFO(sprintf(
                        "SHOCKWAVE by %s: damage = %f, force = %f.\n",
-                       self.netname,
+                       actor.netname,
                        final_damage,
                        vlen(final_force)
                ));
                        final_damage,
                        vlen(final_force)
                ));
@@ -674,11 +674,10 @@ void W_Shockwave_Attack(entity actor)
 
 METHOD(Shockwave, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(Shockwave, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
-        { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false); }
+    if(vdist(actor.origin - actor.enemy.origin, <=, WEP_CVAR(shockwave, melee_range)))
+        { PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, 1000000, 0, 0.001, false); }
     else
     else
-        { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false); }
+        { PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 1000000, 0, 0.001, false); }
 }
 METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index 8de7b6fb30dbc677e4ab630781d0d924879b77f5..06c48b115b097df4e914c1ff03e72552318d8f1b 100644 (file)
@@ -59,22 +59,22 @@ REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
 spawnfunc(weapon_shotgun) { weapon_defaultspawnfunc(this, WEP_SHOTGUN); }
 
 void W_Shotgun_Attack(Weapon thiswep, entity actor, float isprimary)
 spawnfunc(weapon_shotgun) { weapon_defaultspawnfunc(this, WEP_SHOTGUN); }
 
 void W_Shotgun_Attack(Weapon thiswep, entity actor, float isprimary)
-{entity this = actor;
+{
        float   sc;
        entity flash;
 
        float   sc;
        entity flash;
 
-       W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(shotgun, ammo));
+       W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(shotgun, ammo));
 
 
-       W_SetupShot(self, true, 5, SND_SHOTGUN_FIRE, ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
+       W_SetupShot(actor, true, 5, SND_SHOTGUN_FIRE, ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
        for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
        for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
-               fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
+               fireBullet(actor, w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
 
        Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
 
        // casing code
        if(autocvar_g_casings >= 1)
                for(sc = 0;sc < WEP_CVAR_PRI(shotgun, ammo);sc = sc + 1)
 
        Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
 
        // casing code
        if(autocvar_g_casings >= 1)
                for(sc = 0;sc < WEP_CVAR_PRI(shotgun, ammo);sc = sc + 1)
-                       SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self);
+                       SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, actor);
 
        // muzzle flash for 1st person view
        flash = spawn();
 
        // muzzle flash for 1st person view
        flash = spawn();
@@ -82,7 +82,7 @@ void W_Shotgun_Attack(Weapon thiswep, entity actor, float isprimary)
        setthink(flash, SUB_Remove);
        flash.nextthink = time + 0.06;
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
        setthink(flash, SUB_Remove);
        flash.nextthink = time + 0.06;
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-       W_AttachToShotorg(self, flash, '5 0 0');
+       W_AttachToShotorg(actor, flash, '5 0 0');
 }
 
 .float swing_prev;
 }
 
 .float swing_prev;
@@ -94,47 +94,47 @@ void W_Shotgun_Melee_Think(entity this)
        entity target_victim;
        vector targpos;
 
        entity target_victim;
        vector targpos;
 
-       if(!self.cnt) // set start time of melee
+       if(!this.cnt) // set start time of melee
        {
        {
-               self.cnt = time;
-               W_PlayStrengthSound(self.realowner);
+               this.cnt = time;
+               W_PlayStrengthSound(this.realowner);
        }
 
        }
 
-       makevectors(self.realowner.v_angle); // update values for v_* vectors
+       makevectors(this.realowner.v_angle); // update values for v_* vectors
 
        // calculate swing percentage based on time
        meleetime = WEP_CVAR_SEC(shotgun, melee_time) * W_WeaponRateFactor(this.realowner);
 
        // calculate swing percentage based on time
        meleetime = WEP_CVAR_SEC(shotgun, melee_time) * W_WeaponRateFactor(this.realowner);
-       swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
+       swing = bound(0, (this.cnt + meleetime - time) / meleetime, 10);
        f = ((1 - swing) * WEP_CVAR_SEC(shotgun, melee_traces));
 
        // check to see if we can still continue, otherwise give up now
        f = ((1 - swing) * WEP_CVAR_SEC(shotgun, melee_traces));
 
        // check to see if we can still continue, otherwise give up now
-       if(IS_DEAD(self.realowner) && WEP_CVAR_SEC(shotgun, melee_no_doubleslap))
+       if(IS_DEAD(this.realowner) && WEP_CVAR_SEC(shotgun, melee_no_doubleslap))
        {
        {
-               remove(self);
+               remove(this);
                return;
        }
 
        // if okay, perform the traces needed for this frame
                return;
        }
 
        // if okay, perform the traces needed for this frame
-       for(i=self.swing_prev; i < f; ++i)
+       for(i=this.swing_prev; i < f; ++i)
        {
                swing_factor = ((1 - (i / WEP_CVAR_SEC(shotgun, melee_traces))) * 2 - 1);
 
        {
                swing_factor = ((1 - (i / WEP_CVAR_SEC(shotgun, melee_traces))) * 2 - 1);
 
-               targpos = (self.realowner.origin + self.realowner.view_ofs
+               targpos = (this.realowner.origin + this.realowner.view_ofs
                        + (v_forward * WEP_CVAR_SEC(shotgun, melee_range))
                        + (v_up * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_up))
                        + (v_right * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_side)));
 
                        + (v_forward * WEP_CVAR_SEC(shotgun, melee_range))
                        + (v_up * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_up))
                        + (v_right * swing_factor * WEP_CVAR_SEC(shotgun, melee_swing_side)));
 
-               WarpZone_traceline_antilag(self, self.realowner.origin + self.realowner.view_ofs, targpos, false, self.realowner, ANTILAG_LATENCY(self.realowner));
+               WarpZone_traceline_antilag(this, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ANTILAG_LATENCY(this.realowner));
 
                // draw lightning beams for debugging
 
                // draw lightning beams for debugging
-               //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
+               //te_lightning2(world, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
                //te_customflash(targpos, 40,  2, '1 1 1');
 
                is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
 
                //te_customflash(targpos, 40,  2, '1 1 1');
 
                is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
 
-               if((trace_fraction < 1) // if trace is good, apply the damage and remove self
+               if((trace_fraction < 1) // if trace is good, apply the damage and remove this
                        && (trace_ent.takedamage == DAMAGE_AIM)
                        && (trace_ent.takedamage == DAMAGE_AIM)
-                       && (trace_ent != self.swing_alreadyhit)
+                       && (trace_ent != this.swing_alreadyhit)
                        && (is_player || WEP_CVAR_SEC(shotgun, melee_nonplayerdamage)))
                {
                        target_victim = trace_ent; // so it persists through other calls
                        && (is_player || WEP_CVAR_SEC(shotgun, melee_nonplayerdamage)))
                {
                        target_victim = trace_ent; // so it persists through other calls
@@ -144,42 +144,42 @@ void W_Shotgun_Melee_Think(entity this)
                        else
                                swing_damage = (WEP_CVAR_SEC(shotgun, melee_nonplayerdamage) * min(1, swing_factor + 1));
 
                        else
                                swing_damage = (WEP_CVAR_SEC(shotgun, melee_nonplayerdamage) * min(1, swing_factor + 1));
 
-                       //print(strcat(self.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n"));
+                       //print(strcat(this.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n"));
 
 
-                       Damage(target_victim, self.realowner, self.realowner,
+                       Damage(target_victim, this.realowner, this.realowner,
                                swing_damage, WEP_SHOTGUN.m_id | HITTYPE_SECONDARY,
                                swing_damage, WEP_SHOTGUN.m_id | HITTYPE_SECONDARY,
-                               self.realowner.origin + self.realowner.view_ofs,
+                               this.realowner.origin + this.realowner.view_ofs,
                                v_forward * WEP_CVAR_SEC(shotgun, force));
 
                                v_forward * WEP_CVAR_SEC(shotgun, force));
 
-                       if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_SHOTGUN.m_id, 0, swing_damage); }
+                       if(accuracy_isgooddamage(this.realowner, target_victim)) { accuracy_add(this.realowner, WEP_SHOTGUN.m_id, 0, swing_damage); }
 
                        // draw large red flash for debugging
                        //te_customflash(targpos, 200, 2, '15 0 0');
 
                        if(WEP_CVAR_SEC(shotgun, melee_multihit)) // allow multiple hits with one swing, but not against the same player twice.
                        {
 
                        // draw large red flash for debugging
                        //te_customflash(targpos, 200, 2, '15 0 0');
 
                        if(WEP_CVAR_SEC(shotgun, melee_multihit)) // allow multiple hits with one swing, but not against the same player twice.
                        {
-                               self.swing_alreadyhit = target_victim;
+                               this.swing_alreadyhit = target_victim;
                                continue; // move along to next trace
                        }
                        else
                        {
                                continue; // move along to next trace
                        }
                        else
                        {
-                               remove(self);
+                               remove(this);
                                return;
                        }
                }
        }
 
                                return;
                        }
                }
        }
 
-       if(time >= self.cnt + meleetime)
+       if(time >= this.cnt + meleetime)
        {
                // melee is finished
        {
                // melee is finished
-               remove(self);
+               remove(this);
                return;
        }
        else
        {
                // set up next frame
                return;
        }
        else
        {
                // set up next frame
-               self.swing_prev = i;
-               self.nextthink = time;
+               this.swing_prev = i;
+               this.nextthink = time;
        }
 }
 
        }
 }
 
@@ -228,11 +228,10 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity
 
 METHOD(Shotgun, wr_aim, void(entity thiswep, entity actor))
 {
 
 METHOD(Shotgun, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    if(vdist(self.origin - self.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range)))
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false);
+    if(vdist(actor.origin - actor.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range)))
+        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
     else
     else
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
 }
 METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -282,8 +281,7 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
 }
 METHOD(Shotgun, wr_setup, void(entity thiswep, entity actor))
 {
 }
 METHOD(Shotgun, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.ammo_field = ammo_none;
+    actor.ammo_field = ammo_none;
 }
 METHOD(Shotgun, wr_checkammo1, bool(entity thiswep, entity actor))
 {
 }
 METHOD(Shotgun, wr_checkammo1, bool(entity thiswep, entity actor))
 {
@@ -330,14 +328,13 @@ METHOD(Shotgun, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Shotgun, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Shotgun, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_SHOTGUN_IMPACT, org2, w_backoff * 1000, 1);
     vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_SHOTGUN_IMPACT, org2, w_backoff * 1000, 1);
-    if(!w_issilent && time - self.prevric > 0.25)
+    if(!w_issilent && time - actor.prevric > 0.25)
     {
         if(w_random < 0.05)
     {
         if(w_random < 0.05)
-            sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
-        self.prevric = time;
+            sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
+        actor.prevric = time;
     }
 }
 
     }
 }
 
index 147f2e00ead68384af713927ccaba1b88c6c0209..c0e0ac89ba89814e3fd8fab83b8e0f8e30a00a41 100644 (file)
@@ -280,80 +280,80 @@ void W_Tuba_NoteThink(entity this)
        float vol0, vol1;
        vector dir0, dir1;
        vector v;
        float vol0, vol1;
        vector dir0, dir1;
        vector v;
-       if(time > self.teleport_time)
+       if(time > this.teleport_time)
        {
                W_Tuba_NoteOff(this);
                return;
        }
        {
                W_Tuba_NoteOff(this);
                return;
        }
-       self.nextthink = time;
+       this.nextthink = time;
        dist_mult = WEP_CVAR(tuba, attenuation) / autocvar_snd_soundradius;
        dist_mult = WEP_CVAR(tuba, attenuation) / autocvar_snd_soundradius;
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != self.realowner, {
-               v = self.origin - (it.origin + it.view_ofs);
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != this.realowner, {
+               v = this.origin - (it.origin + it.view_ofs);
                vol0 = max(0, 1 - vlen(v) * dist_mult);
                dir0 = normalize(v);
                vol0 = max(0, 1 - vlen(v) * dist_mult);
                dir0 = normalize(v);
-               v = self.realowner.origin - (it.origin + it.view_ofs);
+               v = this.realowner.origin - (it.origin + it.view_ofs);
                vol1 = max(0, 1 - vlen(v) * dist_mult);
                dir1 = normalize(v);
                if(fabs(vol0 - vol1) > 0.005) // 0.5 percent change in volume
                {
                vol1 = max(0, 1 - vlen(v) * dist_mult);
                dir1 = normalize(v);
                if(fabs(vol0 - vol1) > 0.005) // 0.5 percent change in volume
                {
-                       setorigin(self, self.realowner.origin);
-                       self.SendFlags |= 2;
+                       setorigin(this, this.realowner.origin);
+                       this.SendFlags |= 2;
                        break;
                }
                if(dir0 * dir1 < 0.9994) // 2 degrees change in angle
                {
                        break;
                }
                if(dir0 * dir1 < 0.9994) // 2 degrees change in angle
                {
-                       setorigin(self, self.realowner.origin);
-                       self.SendFlags |= 2;
+                       setorigin(this, this.realowner.origin);
+                       this.SendFlags |= 2;
                        break;
                }
        });
 }
 
 void W_Tuba_NoteOn(entity actor, float hittype)
                        break;
                }
        });
 }
 
 void W_Tuba_NoteOn(entity actor, float hittype)
-{entity this = actor;
+{
        vector o;
        float n;
 
        vector o;
        float n;
 
-       W_SetupShot(self, false, 2, SND_Null, 0, WEP_CVAR(tuba, damage));
+       W_SetupShot(actor, false, 2, SND_Null, 0, WEP_CVAR(tuba, damage));
 
 
-       n = W_Tuba_GetNote(self, hittype);
+       n = W_Tuba_GetNote(actor, hittype);
 
        hittype = 0;
 
        hittype = 0;
-       if(self.tuba_instrument & 1)
+       if(actor.tuba_instrument & 1)
                hittype |= HITTYPE_SECONDARY;
                hittype |= HITTYPE_SECONDARY;
-       if(self.tuba_instrument & 2)
+       if(actor.tuba_instrument & 2)
                hittype |= HITTYPE_BOUNCE;
 
                hittype |= HITTYPE_BOUNCE;
 
-       if(self.tuba_note)
+       if(actor.tuba_note)
        {
        {
-               if(self.tuba_note.cnt != n || self.tuba_note.tuba_instrument != self.tuba_instrument)
+               if(actor.tuba_note.cnt != n || actor.tuba_note.tuba_instrument != actor.tuba_instrument)
                {
                {
-                       W_Tuba_NoteOff(self.tuba_note);
+                       W_Tuba_NoteOff(actor.tuba_note);
                }
        }
 
                }
        }
 
-       if(!self.tuba_note)
+       if(!actor.tuba_note)
        {
        {
-               self.tuba_note = new(tuba_note);
-               self.tuba_note.owner = self.tuba_note.realowner = self;
-               self.tuba_note.cnt = n;
-               self.tuba_note.tuba_instrument = self.tuba_instrument;
-               setthink(self.tuba_note, W_Tuba_NoteThink);
-               self.tuba_note.nextthink = time;
-               self.tuba_note.spawnshieldtime = time;
-               Net_LinkEntity(self.tuba_note, false, 0, W_Tuba_NoteSendEntity);
+               actor.tuba_note = new(tuba_note);
+               actor.tuba_note.owner = actor.tuba_note.realowner = actor;
+               actor.tuba_note.cnt = n;
+               actor.tuba_note.tuba_instrument = actor.tuba_instrument;
+               setthink(actor.tuba_note, W_Tuba_NoteThink);
+               actor.tuba_note.nextthink = time;
+               actor.tuba_note.spawnshieldtime = time;
+               Net_LinkEntity(actor.tuba_note, false, 0, W_Tuba_NoteSendEntity);
        }
 
        }
 
-       self.tuba_note.teleport_time = time + WEP_CVAR(tuba, refire) * 2 * W_WeaponRateFactor(actor); // so it can get prolonged safely
+       actor.tuba_note.teleport_time = time + WEP_CVAR(tuba, refire) * 2 * W_WeaponRateFactor(actor); // so it can get prolonged safely
 
 
-       //sound(self, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), autocvar_g_balance_tuba_attenuation);
-       RadiusDamage(self, self, WEP_CVAR(tuba, damage), WEP_CVAR(tuba, edgedamage), WEP_CVAR(tuba, radius), NULL, NULL, WEP_CVAR(tuba, force), hittype | WEP_TUBA.m_id, NULL);
+       //sound(actor, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), autocvar_g_balance_tuba_attenuation);
+       RadiusDamage(actor, actor, WEP_CVAR(tuba, damage), WEP_CVAR(tuba, edgedamage), WEP_CVAR(tuba, radius), NULL, NULL, WEP_CVAR(tuba, force), hittype | WEP_TUBA.m_id, NULL);
 
 
-       o = gettaginfo(self.exteriorweaponentity, 0);
-       if(time > self.tuba_smoketime)
+       o = gettaginfo(actor.exteriorweaponentity, 0);
+       if(time > actor.tuba_smoketime)
        {
                Send_Effect(EFFECT_SMOKE_RING, o + v_up * 45 + v_right * -6 + v_forward * 8, v_up * 100, 1);
        {
                Send_Effect(EFFECT_SMOKE_RING, o + v_up * 45 + v_right * -6 + v_forward * 8, v_up * 100, 1);
-               self.tuba_smoketime = time + 0.25;
+               actor.tuba_smoketime = time + 0.25;
        }
 }
 #endif
        }
 }
 #endif
index ee77fc1c128b9f08bcdfc51e3d24d00b0d28c59d..c660279efa0899bd098733814cc8a12f10d6346c 100644 (file)
@@ -169,63 +169,63 @@ spawnfunc(weapon_vaporizer) { weapon_defaultspawnfunc(this, WEP_VAPORIZER); }
 spawnfunc(weapon_minstanex) { spawnfunc_weapon_vaporizer(this); }
 
 void W_RocketMinsta_Explosion(entity actor, vector loc)
 spawnfunc(weapon_minstanex) { spawnfunc_weapon_vaporizer(this); }
 
 void W_RocketMinsta_Explosion(entity actor, vector loc)
-{entity this = actor;
-       if(accuracy_canbegooddamage(self))
-               accuracy_add(self, WEP_DEVASTATOR.m_id, autocvar_g_rm_damage, 0);
+{
+       if(accuracy_canbegooddamage(actor))
+               accuracy_add(actor, WEP_DEVASTATOR.m_id, autocvar_g_rm_damage, 0);
        entity dmgent = spawn();
        entity dmgent = spawn();
-       dmgent.owner = dmgent.realowner = self;
+       dmgent.owner = dmgent.realowner = actor;
        setorigin(dmgent, loc);
        setorigin(dmgent, loc);
-       RadiusDamage (dmgent, self, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, world, world, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other);
+       RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, world, world, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other);
        remove(dmgent);
 }
 
 void W_Vaporizer_Attack(Weapon thiswep, entity actor)
        remove(dmgent);
 }
 
 void W_Vaporizer_Attack(Weapon thiswep, entity actor)
-{entity this = actor;
-       bool flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
+{
+       bool flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
        float vaporizer_damage = ((WEP_CVAR_PRI(vaporizer, damage) > 0) ? WEP_CVAR_PRI(vaporizer, damage) : 10000);
 
        float vaporizer_damage = ((WEP_CVAR_PRI(vaporizer, damage) > 0) ? WEP_CVAR_PRI(vaporizer, damage) : 10000);
 
-       W_SetupShot(self, true, 0, SND_Null, CH_WEAPON_A, vaporizer_damage);
+       W_SetupShot(actor, true, 0, SND_Null, CH_WEAPON_A, vaporizer_damage);
        // handle sound separately so we can change the volume
        // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway)
        // handle sound separately so we can change the volume
        // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway)
-       sound (self, CH_WEAPON_A, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM);
+       sound (actor, CH_WEAPON_A, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM);
 
        yoda = 0;
        damage_goodhits = 0;
 
        yoda = 0;
        damage_goodhits = 0;
-       FireRailgunBullet(self, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id);
+       FireRailgunBullet(actor, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id);
 
        // do this now, as goodhits is disabled below
 
        // do this now, as goodhits is disabled below
-       SendCSQCVaporizerBeamParticle(self, damage_goodhits);
+       SendCSQCVaporizerBeamParticle(actor, damage_goodhits);
 
        if(yoda && flying)
 
        if(yoda && flying)
-               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
-       if(damage_goodhits && self.vaporizer_lasthit)
+               Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+       if(damage_goodhits && actor.vaporizer_lasthit)
        {
        {
-               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+               Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
                damage_goodhits = 0; // only every second time
        }
 
                damage_goodhits = 0; // only every second time
        }
 
-       self.vaporizer_lasthit = damage_goodhits;
+       actor.vaporizer_lasthit = damage_goodhits;
 
        if(autocvar_g_rm)
        if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
 
        if(autocvar_g_rm)
        if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
-               W_RocketMinsta_Explosion(self, trace_endpos);
+               W_RocketMinsta_Explosion(actor, trace_endpos);
 
 
-       W_DecreaseAmmo(thiswep, self, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
+       W_DecreaseAmmo(thiswep, actor, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
 }
 
 void W_RocketMinsta_Laser_Explode (entity this)
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
 }
 
 void W_RocketMinsta_Laser_Explode (entity this)
 {
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
-                       if(DIFF_TEAM(self.realowner, other))
+                       if(DIFF_TEAM(this.realowner, other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                if(!IS_DEAD(other))
                                        if(IsFlying(other))
-                                               Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
+                                               Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
 
 
-       self.event_damage = func_null;
-       self.takedamage = DAMAGE_NO;
-       RadiusDamage (self, self.realowner, self.rm_damage, self.rm_edmg, autocvar_g_rm_laser_radius, world, world, self.rm_force, self.projectiledeathtype, other);
-       remove(self);
+       this.event_damage = func_null;
+       this.takedamage = DAMAGE_NO;
+       RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, world, world, this.rm_force, this.projectiledeathtype, other);
+       remove(this);
 }
 
 void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger)
 }
 
 void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger)
@@ -237,13 +237,13 @@ void W_RocketMinsta_Laser_Touch (entity this)
 {
        PROJECTILE_TOUCH(this);
        //W_RocketMinsta_Laser_Explode ();
 {
        PROJECTILE_TOUCH(this);
        //W_RocketMinsta_Laser_Explode ();
-       RadiusDamage (self, self.realowner, self.rm_damage, self.rm_edmg, autocvar_g_rm_laser_radius, world, world, self.rm_force, self.projectiledeathtype, other);
-       remove(self);
+       RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, world, world, this.rm_force, this.projectiledeathtype, other);
+       remove(this);
 }
 
 void W_RocketMinsta_Attack2(entity actor)
 }
 
 void W_RocketMinsta_Attack2(entity actor)
-{entity this = actor;
-       makevectors(self.v_angle);
+{
+       makevectors(actor.v_angle);
 
        entity proj;
        float counter = 0;
 
        entity proj;
        float counter = 0;
@@ -251,17 +251,17 @@ void W_RocketMinsta_Attack2(entity actor)
        float spread = autocvar_g_rm_laser_spread;
        float rndspread = autocvar_g_rm_laser_spread_random;
 
        float spread = autocvar_g_rm_laser_spread;
        float rndspread = autocvar_g_rm_laser_spread_random;
 
-       Weapon w = PS(self).m_weapon;
-       PS(self).m_weapon = WEP_ELECTRO;
-       W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, autocvar_g_rm_laser_damage);
-       PS(self).m_weapon = w;
+       Weapon w = PS(actor).m_weapon;
+       PS(actor).m_weapon = WEP_ELECTRO;
+       W_SetupShot_ProjectileSize (actor, '0 0 -3', '0 0 -3', false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, autocvar_g_rm_laser_damage);
+       PS(actor).m_weapon = w;
 
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
     while(counter < total)
        {
         proj = new(plasma_prim);
 
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
     while(counter < total)
        {
         proj = new(plasma_prim);
-        proj.owner = proj.realowner = self;
+        proj.owner = proj.realowner = actor;
         proj.bot_dodge = true;
         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
         proj.use = W_RocketMinsta_Laser_Explode_use;
         proj.bot_dodge = true;
         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
         proj.use = W_RocketMinsta_Laser_Explode_use;
@@ -290,30 +290,30 @@ void W_RocketMinsta_Attack2(entity actor)
 
         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
 
 
         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
 
-        MUTATOR_CALLHOOK(EditProjectile, self, proj);
+        MUTATOR_CALLHOOK(EditProjectile, actor, proj);
         counter++;
     }
 }
 
 void W_RocketMinsta_Attack3 (entity actor)
         counter++;
     }
 }
 
 void W_RocketMinsta_Attack3 (entity actor)
-{entity this = actor;
-       makevectors(self.v_angle);
+{
+       makevectors(actor.v_angle);
 
        entity proj;
        float counter = 0;
        float total = 1;
 
 
        entity proj;
        float counter = 0;
        float total = 1;
 
-       Weapon w = PS(self).m_weapon;
-       PS(self).m_weapon = WEP_ELECTRO;
-       W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND_ELECTRO_FIRE2, CH_WEAPON_A, autocvar_g_rm_laser_damage);
-       PS(self).m_weapon = w;
+       Weapon w = PS(actor).m_weapon;
+       PS(actor).m_weapon = WEP_ELECTRO;
+       W_SetupShot_ProjectileSize (actor, '0 0 -3', '0 0 -3', false, 2, SND_ELECTRO_FIRE2, CH_WEAPON_A, autocvar_g_rm_laser_damage);
+       PS(actor).m_weapon = w;
 
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
     while(counter < total)
        {
         proj = new(plasma_prim);
 
        Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
     while(counter < total)
        {
         proj = new(plasma_prim);
-        proj.owner = proj.realowner = self;
+        proj.owner = proj.realowner = actor;
         proj.bot_dodge = true;
         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
         proj.use = W_RocketMinsta_Laser_Explode_use;
         proj.bot_dodge = true;
         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
         proj.use = W_RocketMinsta_Laser_Explode_use;
@@ -340,18 +340,17 @@ void W_RocketMinsta_Attack3 (entity actor)
 
         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
 
 
         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
 
-        MUTATOR_CALLHOOK(EditProjectile, self, proj);
+        MUTATOR_CALLHOOK(EditProjectile, actor, proj);
         counter++;
     }
 }
 
 METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor))
 {
         counter++;
     }
 }
 
 METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    if(self.(thiswep.ammo_field) > 0)
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 1, false);
+    if(actor.(thiswep.ammo_field) > 0)
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 1000000, 0, 1, false);
     else
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
+        PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
 }
 METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
 }
 METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -429,9 +428,8 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent
 }
 METHOD(Vaporizer, wr_setup, void(entity thiswep, entity actor))
 {
 }
 METHOD(Vaporizer, wr_setup, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.ammo_field = (thiswep.ammo_field);
-    self.vaporizer_lasthit = 0;
+    actor.ammo_field = (thiswep.ammo_field);
+    actor.vaporizer_lasthit = 0;
 }
 METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep, entity actor))
 {
 }
 METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep, entity actor))
 {
@@ -450,8 +448,7 @@ METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep, entity actor))
 }
 METHOD(Vaporizer, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Vaporizer, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    self.vaporizer_lasthit = 0;
+    actor.vaporizer_lasthit = 0;
 }
 METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
 }
 METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
@@ -478,17 +475,16 @@ METHOD(Vaporizer, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Vaporizer, wr_impacteffect, void(entity thiswep, entity actor))
 {
 
 METHOD(Vaporizer, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     vector org2 = w_org + w_backoff * 6;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
     vector org2 = w_org + w_backoff * 6;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
-        if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
+        if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
     }
     else
     {
         pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
     }
     else
     {
         pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
-        if(!w_issilent) { sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); }
+        if(!w_issilent) { sound(actor, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); }
     }
 }
 METHOD(Vaporizer, wr_init, void(entity thiswep))
     }
 }
 METHOD(Vaporizer, wr_init, void(entity thiswep))
index 0169c4b082ffe378ecc09a8dc89e9c44d1ad14c8..d523686d636837cbee45ed7b4a1a72ccf3a95331 100644 (file)
@@ -158,7 +158,7 @@ MUTATOR_HOOKFUNCTION(vortex_charge, GetPressedKeys)
 }
 
 void W_Vortex_Attack(Weapon thiswep, entity actor, float issecondary)
 }
 
 void W_Vortex_Attack(Weapon thiswep, entity actor, float issecondary)
-{entity this = actor;
+{
        float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
 
        mydmg = WEP_CVAR_BOTH(vortex, !issecondary, damage);
        float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
 
        mydmg = WEP_CVAR_BOTH(vortex, !issecondary, damage);
@@ -170,12 +170,12 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, float issecondary)
        myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo);
 
        float flying;
        myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo);
 
        float flying;
-       flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
+       flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
 
        if(WEP_CVAR(vortex, charge))
        {
 
        if(WEP_CVAR(vortex, charge))
        {
-               charge = WEP_CVAR(vortex, charge_mindmg) / mydmg + (1 - WEP_CVAR(vortex, charge_mindmg) / mydmg) * self.vortex_charge;
-               self.vortex_charge *= WEP_CVAR(vortex, charge_shot_multiplier); // do this AFTER setting mydmg/myforce
+               charge = WEP_CVAR(vortex, charge_mindmg) / mydmg + (1 - WEP_CVAR(vortex, charge_mindmg) / mydmg) * actor.vortex_charge;
+               actor.vortex_charge *= WEP_CVAR(vortex, charge_shot_multiplier); // do this AFTER setting mydmg/myforce
                // O RLY? -- divVerent
                // YA RLY -- FruitieX
        }
                // O RLY? -- divVerent
                // YA RLY -- FruitieX
        }
@@ -184,43 +184,42 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, float issecondary)
        mydmg *= charge;
        myforce *= charge;
 
        mydmg *= charge;
        myforce *= charge;
 
-       W_SetupShot(self, true, 5, SND_NEXFIRE, CH_WEAPON_A, mydmg);
+       W_SetupShot(actor, true, 5, SND_NEXFIRE, CH_WEAPON_A, mydmg);
        if(charge > WEP_CVAR(vortex, charge_animlimit) && WEP_CVAR(vortex, charge_animlimit)) // if the Vortex is overcharged, we play an extra sound
        {
        if(charge > WEP_CVAR(vortex, charge_animlimit) && WEP_CVAR(vortex, charge_animlimit)) // if the Vortex is overcharged, we play an extra sound
        {
-               sound(self, CH_WEAPON_B, SND_NEXCHARGE, VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM);
+               sound(actor, CH_WEAPON_B, SND_NEXCHARGE, VOL_BASE * (charge - 0.5 * WEP_CVAR(vortex, charge_animlimit)) / (1 - 0.5 * WEP_CVAR(vortex, charge_animlimit)), ATTN_NORM);
        }
 
        yoda = 0;
        damage_goodhits = 0;
        }
 
        yoda = 0;
        damage_goodhits = 0;
-       FireRailgunBullet(self, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id);
+       FireRailgunBullet(actor, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id);
 
        if(yoda && flying)
 
        if(yoda && flying)
-               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
-       if(damage_goodhits && self.vortex_lasthit)
+               Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+       if(damage_goodhits && actor.vortex_lasthit)
        {
        {
-               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+               Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
                damage_goodhits = 0; // only every second time
        }
 
                damage_goodhits = 0; // only every second time
        }
 
-       self.vortex_lasthit = damage_goodhits;
+       actor.vortex_lasthit = damage_goodhits;
 
        //beam and muzzle flash done on client
        SendCSQCVortexBeamParticle(charge);
 
 
        //beam and muzzle flash done on client
        SendCSQCVortexBeamParticle(charge);
 
-       W_DecreaseAmmo(thiswep, self, myammo);
+       W_DecreaseAmmo(thiswep, actor, myammo);
 }
 
 .float vortex_chargepool_pauseregen_finished;
 
 METHOD(Vortex, wr_aim, void(entity thiswep, entity actor))
 {
 }
 
 .float vortex_chargepool_pauseregen_finished;
 
 METHOD(Vortex, wr_aim, void(entity thiswep, entity actor))
 {
-    entity this = actor;
-    if(bot_aim(self, 1000000, 0, 1, false))
-        PHYS_INPUT_BUTTON_ATCK(self) = true;
+    if(bot_aim(actor, 1000000, 0, 1, false))
+        PHYS_INPUT_BUTTON_ATCK(actor) = true;
     else
     {
         if(WEP_CVAR(vortex, charge))
     else
     {
         if(WEP_CVAR(vortex, charge))
-            PHYS_INPUT_BUTTON_ATCK2(self) = true;
+            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
     }
 }
 METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
     }
 }
 METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
@@ -349,14 +348,13 @@ METHOD(Vortex, wr_checkammo2, bool(entity thiswep, entity actor))
 }
 METHOD(Vortex, wr_resetplayer, void(entity thiswep, entity actor))
 {
 }
 METHOD(Vortex, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    entity this = actor;
     if (WEP_CVAR(vortex, charge)) {
         if (WEP_CVAR_SEC(vortex, chargepool)) {
     if (WEP_CVAR(vortex, charge)) {
         if (WEP_CVAR_SEC(vortex, chargepool)) {
-            self.vortex_chargepool_ammo = 1;
+            actor.vortex_chargepool_ammo = 1;
         }
         }
-        self.vortex_charge = WEP_CVAR(vortex, charge_start);
+        actor.vortex_charge = WEP_CVAR(vortex, charge_start);
     }
     }
-    self.vortex_lasthit = 0;
+    actor.vortex_lasthit = 0;
 }
 METHOD(Vortex, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
 }
 METHOD(Vortex, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
index d4a25089fc5a2bf88eddee18ccb51a91e6e85830..3e7e020c67a5fea2ea7368fb3444a30f9fbebea2 100644 (file)
@@ -9,7 +9,7 @@
        class(Defer).entity owner;
        class(Defer).void(entity) defer_func;
 
        class(Defer).entity owner;
        class(Defer).void(entity) defer_func;
 
-       /** Remove self */
+       /** Remove entity */
        void SUB_Remove(entity this)
        {
                remove(this);
        void SUB_Remove(entity this)
        {
                remove(this);
index 58375001453060dd454dd2d8bd04e8bb8802b2ef..fe26b08a415cc32a381b8040fc5448d003017e31 100644 (file)
@@ -29,7 +29,7 @@
 #endif
 
 // Step 5: this should work
 #endif
 
 // Step 5: this should work
-#if 0
+#if 1
     #undef self
     #define self (0, this)
 #endif
     #undef self
     #define self (0, this)
 #endif
index 28c11e91ce225b6ef7b9ef1bf1db1dd113b0eb0c..c373e1eaeec99324b910372846930a12991738bb 100644 (file)
@@ -206,7 +206,7 @@ void WarpZone_Touch (entity this)
 #endif
                return;
 
 #endif
                return;
 
-       if(WarpZoneLib_ExactTrigger_Touch(self, other))
+       if(WarpZoneLib_ExactTrigger_Touch(this, other))
                return;
 
 #ifdef SVQC
                return;
 
 #ifdef SVQC
index ebbacd6b8e2835ae66d694d86b903166c4408f22..bbb1c863422704ec2db8e3d1d09a15ce3c8dcd92 100644 (file)
@@ -156,8 +156,8 @@ void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1,
        }
        this.bot_aimtarg = e1;
        this.bot_aimlatency = this.ping; // FIXME?  Shouldn't this be in the lag item?
        }
        this.bot_aimtarg = e1;
        this.bot_aimlatency = this.ping; // FIXME?  Shouldn't this be in the lag item?
-       //this.bot_aimselforigin = v1;
-       //this.bot_aimselfvelocity = v2;
+       //this.bot_aimorigin = v1;
+       //this.bot_aimvelocity = v2;
        this.bot_aimtargorigin = v3;
        this.bot_aimtargvelocity = v4;
        if(skill <= 0)
        this.bot_aimtargorigin = v3;
        this.bot_aimtargvelocity = v4;
        if(skill <= 0)
index a26e64bc792aa14a8ae96f2510c79d88f7d66048..dfe10e265688a8db44aa7c794ed76eb68bd69bd4 100644 (file)
@@ -74,8 +74,8 @@ vector shotdir;
 .vector bot_5th_order_aimfilter;
 .vector bot_olddesiredang;
 
 .vector bot_5th_order_aimfilter;
 .vector bot_olddesiredang;
 
-//.vector bot_aimselforigin;
-//.vector bot_aimselfvelocity;
+//.vector bot_aimorigin;
+//.vector bot_aimvelocity;
 .vector bot_aimtargorigin;
 .vector bot_aimtargvelocity;
 
 .vector bot_aimtargorigin;
 .vector bot_aimtargvelocity;
 
index 94816a1a77d9606f33b8cb5a90a7131425ca2502..7dda060119dba09c91ab53fd6a0d23e8ad4f10a9 100644 (file)
@@ -295,7 +295,6 @@ float CheatCommand(entity this, int argc)
        {
                float effectnum, f;
                vector start, end;
        {
                float effectnum, f;
                vector start, end;
-               entity oldself;
 
                case "pointparticles":
                        IS_CHEAT(this, 0, argc, 0);
 
                case "pointparticles":
                        IS_CHEAT(this, 0, argc, 0);
@@ -552,11 +551,11 @@ float CheatCommand(entity this, int argc)
                                {
                                        start = '0 0 0';
                                        effectnum = 0;
                                {
                                        start = '0 0 0';
                                        effectnum = 0;
-                                       for(oldself = world; (oldself = find(oldself, classname, "dragbox_box")); )
+                                       for(entity ent = world; (ent = find(ent, classname, "dragbox_box")); )
                                        {
                                        {
-                                               if(e.cnt <= 0 && oldself.cnt == 0 || e.cnt == oldself.cnt)
+                                               if(e.cnt <= 0 && ent.cnt == 0 || e.cnt == ent.cnt)
                                                {
                                                {
-                                                       start = start + oldself.origin;
+                                                       start = start + ent.origin;
                                                        ++effectnum;
                                                }
                                        }
                                                        ++effectnum;
                                                }
                                        }
@@ -583,12 +582,12 @@ float CheatCommand(entity this, int argc)
                                                        // these need race_place
                                                        // counting...
                                                        effectnum = 1;
                                                        // these need race_place
                                                        // counting...
                                                        effectnum = 1;
-                                                       for(oldself = world; (oldself = find(oldself, classname, "dragpoint")); )
-                                                       if(oldself.cnt == 0)
+                                                       for(entity ent = world; (ent = find(ent, classname, "dragpoint")); )
+                                                       if(ent.cnt == 0)
                                                        {
                                                        {
-                                                               if(vlen(oldself.origin - start) < vlen(e.origin - start))
+                                                               if(vlen2(ent.origin - start) < vlen2(e.origin - start))
                                                                        ++effectnum;
                                                                        ++effectnum;
-                                                               else if(vlen(oldself.origin - start) == vlen(e.origin - start) && etof(oldself) < etof(e))
+                                                               else if(vlen2(ent.origin - start) == vlen2(e.origin - start) && etof(ent) < etof(e))
                                                                        ++effectnum;
                                                        }
                                                        fputs(f, strcat("\"race_place\" \"", ftos(effectnum), "\"\n"));
                                                                        ++effectnum;
                                                        }
                                                        fputs(f, strcat("\"race_place\" \"", ftos(effectnum), "\"\n"));
index 250f3cda1a0113b5d168761688ce6f564647e063..173191ddc27502c616025b28cd515662bcd83215 100644 (file)
@@ -704,7 +704,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
        // for now, just give "say" back and only handle say_team
        if(!teamsay)
        {
        // for now, just give "say" back and only handle say_team
        if(!teamsay)
        {
-               clientcommand(self, strcat("say ", msgin));
+               clientcommand(source, strcat("say ", msgin));
                return;
        }
        */
                return;
        }
        */
index 1cc6e1d21a02d9eadbad9593ee93be631e0c9e50..ae0a02538a356de409bf375c64ea4ea721e677ab 100644 (file)
@@ -205,7 +205,7 @@ void timeout_handler_think(entity this)
                                if (timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only <sv_timeout_resumetime> seconds are left
                                        Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE);
 
                                if (timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only <sv_timeout_resumetime> seconds are left
                                        Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE);
 
-                               self.nextthink = time + TIMEOUT_SLOWMO_VALUE;       // think again in one second
+                               this.nextthink = time + TIMEOUT_SLOWMO_VALUE;       // think again in one second
                                timeout_time -= 1;                                  // decrease the time counter
                        }
                        else  // time to end the timeout
                                timeout_time -= 1;                                  // decrease the time counter
                        }
                        else  // time to end the timeout
@@ -232,7 +232,7 @@ void timeout_handler_think(entity this)
                        {
                                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime);
 
                        {
                                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime);
 
-                               self.nextthink = time + 1; // think again in one second
+                               this.nextthink = time + 1; // think again in one second
                                timeout_leadtime -= 1;     // decrease the time counter
                        }
                        else  // time to begin the timeout
                                timeout_leadtime -= 1;     // decrease the time counter
                        }
                        else  // time to begin the timeout
@@ -254,7 +254,7 @@ void timeout_handler_think(entity this)
                                        it.lastV_angle = it.v_angle;
                                ));
 
                                        it.lastV_angle = it.v_angle;
                                ));
 
-                               self.nextthink = time;  // think again next frame to handle it under TIMEOUT_ACTIVE code
+                               this.nextthink = time;  // think again next frame to handle it under TIMEOUT_ACTIVE code
                        }
 
                        return;
                        }
 
                        return;
index 616727c5d66b5ad1acb63b46b5eee79f1e69f2ae..dd1d5deafdf16c95396ab63d448f358f858edbd8 100644 (file)
@@ -221,147 +221,147 @@ void RadarMap_Think(entity this)
        float i, x, l;
        string si;
 
        float i, x, l;
        string si;
 
-       if (self.frame == 0)
+       if (this.frame == 0)
        {
                // initialize
                get_mi_min_max_texcoords(1);
        {
                // initialize
                get_mi_min_max_texcoords(1);
-               self.mins = mi_picmin;
-               self.maxs_x = (mi_picmax.x - mi_picmin.x) / self.size.x;
-               self.maxs_y = (mi_picmax.y - mi_picmin.y) / self.size.y;
-               self.maxs_z = mi_max.z - mi_min.z;
-               LOG_INFO("Picture mins/maxs: ", ftos(self.maxs.x), " and ", ftos(self.maxs.y), " should match\n");
-               self.netname = strzone(strcat("gfx/", mi_shortname, "_radar.xpm"));
-               if (!(self.count & 1))
+               this.mins = mi_picmin;
+               this.maxs_x = (mi_picmax.x - mi_picmin.x) / this.size.x;
+               this.maxs_y = (mi_picmax.y - mi_picmin.y) / this.size.y;
+               this.maxs_z = mi_max.z - mi_min.z;
+               LOG_INFO("Picture mins/maxs: ", ftos(this.maxs.x), " and ", ftos(this.maxs.y), " should match\n");
+               this.netname = strzone(strcat("gfx/", mi_shortname, "_radar.xpm"));
+               if (!(this.count & 1))
                {
                {
-                       self.cnt = fopen(self.netname, FILE_READ);
-                       if (self.cnt < 0) self.cnt = fopen(strcat("gfx/", mi_shortname, "_radar.tga"), FILE_READ);
-                       if (self.cnt < 0) self.cnt = fopen(strcat("gfx/", mi_shortname, "_radar.png"), FILE_READ);
-                       if (self.cnt < 0) self.cnt = fopen(strcat("gfx/", mi_shortname, "_radar.jpg"), FILE_READ);
-                       if (self.cnt < 0) self.cnt = fopen(strcat("gfx/", mi_shortname, "_mini.tga"), FILE_READ);
-                       if (self.cnt < 0) self.cnt = fopen(strcat("gfx/", mi_shortname, "_mini.png"), FILE_READ);
-                       if (self.cnt < 0) self.cnt = fopen(strcat("gfx/", mi_shortname, "_mini.jpg"), FILE_READ);
-                       if (self.cnt >= 0)
+                       this.cnt = fopen(this.netname, FILE_READ);
+                       if (this.cnt < 0) this.cnt = fopen(strcat("gfx/", mi_shortname, "_radar.tga"), FILE_READ);
+                       if (this.cnt < 0) this.cnt = fopen(strcat("gfx/", mi_shortname, "_radar.png"), FILE_READ);
+                       if (this.cnt < 0) this.cnt = fopen(strcat("gfx/", mi_shortname, "_radar.jpg"), FILE_READ);
+                       if (this.cnt < 0) this.cnt = fopen(strcat("gfx/", mi_shortname, "_mini.tga"), FILE_READ);
+                       if (this.cnt < 0) this.cnt = fopen(strcat("gfx/", mi_shortname, "_mini.png"), FILE_READ);
+                       if (this.cnt < 0) this.cnt = fopen(strcat("gfx/", mi_shortname, "_mini.jpg"), FILE_READ);
+                       if (this.cnt >= 0)
                        {
                        {
-                               fclose(self.cnt);
+                               fclose(this.cnt);
 
 
-                               LOG_INFO(self.netname, " already exists, aborting (you may want to specify --force)\n");
+                               LOG_INFO(this.netname, " already exists, aborting (you may want to specify --force)\n");
                                RadarMap_Next();
                                return;
                        }
                }
                                RadarMap_Next();
                                return;
                        }
                }
-               self.cnt = fopen(self.netname, FILE_WRITE);
-               if (self.cnt < 0)
+               this.cnt = fopen(this.netname, FILE_WRITE);
+               if (this.cnt < 0)
                {
                {
-                       LOG_INFO("Error writing ", self.netname, "\n");
-                       remove(self);
+                       LOG_INFO("Error writing ", this.netname, "\n");
+                       remove(this);
                        radarmapper = world;
                        return;
                }
                        radarmapper = world;
                        return;
                }
-               LOG_INFO("Writing to ", self.netname, "...\n");
-               fputs(self.cnt, "/* XPM */\n");
-               fputs(self.cnt, "static char *RadarMap[] = {\n");
-               fputs(self.cnt, "/* columns rows colors chars-per-pixel */\n");
-               fputs(self.cnt, strcat("\"", ftos(self.size.x), " ", ftos(self.size.y), " 256 2\",\n"));
+               LOG_INFO("Writing to ", this.netname, "...\n");
+               fputs(this.cnt, "/* XPM */\n");
+               fputs(this.cnt, "static char *RadarMap[] = {\n");
+               fputs(this.cnt, "/* columns rows colors chars-per-pixel */\n");
+               fputs(this.cnt, strcat("\"", ftos(this.size.x), " ", ftos(this.size.y), " 256 2\",\n"));
                for (i = 0; i < 256; ++i)
                {
                        si = substring(doublehex, i * 2, 2);
                for (i = 0; i < 256; ++i)
                {
                        si = substring(doublehex, i * 2, 2);
-                       fputs(self.cnt, strcat("\"", si, " c #", si, si, si, "\",\n"));
+                       fputs(this.cnt, strcat("\"", si, " c #", si, si, si, "\",\n"));
                }
                }
-               self.frame += 1;
-               self.nextthink = time;
-               sharpen_init(self.size.x);
+               this.frame += 1;
+               this.nextthink = time;
+               sharpen_init(this.size.x);
        }
        }
-       else if (self.frame <= self.size.y)
+       else if (this.frame <= this.size.y)
        {
                // fill the sharpen buffer with this line
        {
                // fill the sharpen buffer with this line
-               sharpen_shift(self.size.x);
-               i = self.count & 24;
+               sharpen_shift(this.size.x);
+               i = this.count & 24;
 
                switch (i)
                {
                        case 0:
                        default:
 
                switch (i)
                {
                        case 0:
                        default:
-                               for (x = 0; x < self.size.x; ++x)
+                               for (x = 0; x < this.size.x; ++x)
                                {
                                {
-                                       l = RadarMapAtPoint_Block(self.mins.x + x * self.maxs.x, self.mins.y + (self.size.y - self.frame) * self.maxs.y, self.maxs.x, self.maxs.y, self.mins.z, self.maxs.z, self.size.z);
+                                       l = RadarMapAtPoint_Block(this.mins.x + x * this.maxs.x, this.mins.y + (this.size.y - this.frame) * this.maxs.y, this.maxs.x, this.maxs.y, this.mins.z, this.maxs.z, this.size.z);
                                        sharpen_set(x, l);
                                }
                                break;
                        case 8:
                                        sharpen_set(x, l);
                                }
                                break;
                        case 8:
-                               for (x = 0; x < self.size.x; ++x)
+                               for (x = 0; x < this.size.x; ++x)
                                {
                                {
-                                       l = RadarMapAtPoint_Trace(self.mins.x + x * self.maxs.x, self.mins.y + (self.size.y - self.frame) * self.maxs.y, self.maxs.x, self.maxs.y, self.mins.z, self.maxs.z, self.size.z);
+                                       l = RadarMapAtPoint_Trace(this.mins.x + x * this.maxs.x, this.mins.y + (this.size.y - this.frame) * this.maxs.y, this.maxs.x, this.maxs.y, this.mins.z, this.maxs.z, this.size.z);
                                        sharpen_set(x, l);
                                }
                                break;
                        case 16:
                                        sharpen_set(x, l);
                                }
                                break;
                        case 16:
-                               for (x = 0; x < self.size.x; ++x)
+                               for (x = 0; x < this.size.x; ++x)
                                {
                                {
-                                       l = RadarMapAtPoint_Sample(self.mins.x + x * self.maxs.x, self.mins.y + (self.size.y - self.frame) * self.maxs.y, self.maxs.x, self.maxs.y, self.mins.z, self.maxs.z, self.size.z);
+                                       l = RadarMapAtPoint_Sample(this.mins.x + x * this.maxs.x, this.mins.y + (this.size.y - this.frame) * this.maxs.y, this.maxs.x, this.maxs.y, this.mins.z, this.maxs.z, this.size.z);
                                        sharpen_set(x, l);
                                }
                                break;
                        case 24:
                                        sharpen_set(x, l);
                                }
                                break;
                        case 24:
-                               for (x = 0; x < self.size.x; ++x)
+                               for (x = 0; x < this.size.x; ++x)
                                {
                                {
-                                       l = RadarMapAtPoint_LineBlock(self.mins.x + x * self.maxs.x, self.mins.y + (self.size.y - self.frame) * self.maxs.y, self.maxs.x, self.maxs.y, self.mins.z, self.maxs.z, self.size.z);
+                                       l = RadarMapAtPoint_LineBlock(this.mins.x + x * this.maxs.x, this.mins.y + (this.size.y - this.frame) * this.maxs.y, this.maxs.x, this.maxs.y, this.mins.z, this.maxs.z, this.size.z);
                                        sharpen_set(x, l);
                                }
                                break;
                }
 
                // do we have enough lines?
                                        sharpen_set(x, l);
                                }
                                break;
                }
 
                // do we have enough lines?
-               if (self.frame >= 2)
+               if (this.frame >= 2)
                {
                        // write a pixel line
                {
                        // write a pixel line
-                       fputs(self.cnt, "\"");
-                       for (x = 0; x < self.size.x; ++x)
+                       fputs(this.cnt, "\"");
+                       for (x = 0; x < this.size.x; ++x)
                        {
                        {
-                               l = sharpen_get(x, self.ltime);
-                               fputs(self.cnt, substring(doublehex, 2 * floor(l * 256.0), 2));
+                               l = sharpen_get(x, this.ltime);
+                               fputs(this.cnt, substring(doublehex, 2 * floor(l * 256.0), 2));
                        }
                        }
-                       if (self.frame == self.size.y)
+                       if (this.frame == this.size.y)
                        {
                        {
-                               fputs(self.cnt, "\"\n");
+                               fputs(this.cnt, "\"\n");
                        }
                        else
                        {
                        }
                        else
                        {
-                               fputs(self.cnt, "\",\n");
-                               LOG_INFO(ftos(self.size.y - self.frame), " lines left\n");
+                               fputs(this.cnt, "\",\n");
+                               LOG_INFO(ftos(this.size.y - this.frame), " lines left\n");
                        }
                }
 
                // is this the last line? then write back the missing line
                        }
                }
 
                // is this the last line? then write back the missing line
-               if (self.frame == self.size.y)
+               if (this.frame == this.size.y)
                {
                {
-                       sharpen_shift(self.size.x);
+                       sharpen_shift(this.size.x);
                        // write a pixel line
                        // write a pixel line
-                       fputs(self.cnt, "\"");
-                       for (x = 0; x < self.size.x; ++x)
+                       fputs(this.cnt, "\"");
+                       for (x = 0; x < this.size.x; ++x)
                        {
                        {
-                               l = sharpen_get(x, self.ltime);
-                               fputs(self.cnt, substring(doublehex, 2 * floor(l * 256.0), 2));
+                               l = sharpen_get(x, this.ltime);
+                               fputs(this.cnt, substring(doublehex, 2 * floor(l * 256.0), 2));
                        }
                        }
-                       if (self.frame == self.size.y)
+                       if (this.frame == this.size.y)
                        {
                        {
-                               fputs(self.cnt, "\"\n");
+                               fputs(this.cnt, "\"\n");
                        }
                        else
                        {
                        }
                        else
                        {
-                               fputs(self.cnt, "\",\n");
-                               LOG_INFO(ftos(self.size.y - self.frame), " lines left\n");
+                               fputs(this.cnt, "\",\n");
+                               LOG_INFO(ftos(this.size.y - this.frame), " lines left\n");
                        }
                }
 
                        }
                }
 
-               self.frame += 1;
-               self.nextthink = time;
+               this.frame += 1;
+               this.nextthink = time;
        }
        else
        {
                // close the file
        }
        else
        {
                // close the file
-               fputs(self.cnt, "};\n");
-               fclose(self.cnt);
-               LOG_INFO("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
+               fputs(this.cnt, "};\n");
+               fclose(this.cnt);
+               LOG_INFO("Finished. Please edit data/", this.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
                RadarMap_Next();
        }
 }
                RadarMap_Next();
        }
 }
index 7fbfd536b0d993efe77defd8fcbf15dac01f3cd6..37c994d68eb1fd213d4ec4298232bd9dd42fccac 100644 (file)
@@ -45,12 +45,12 @@ void make_mapinfo_Think(entity this)
        {
                LOG_INFO("Done rebuiling mapinfos.\n");
                MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
        {
                LOG_INFO("Done rebuiling mapinfos.\n");
                MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
-               remove(self);
+               remove(this);
        }
        else
        {
        }
        else
        {
-               setthink(self, make_mapinfo_Think);
-               self.nextthink = time;
+               setthink(this, make_mapinfo_Think);
+               this.nextthink = time;
        }
 }
 
        }
 }
 
index bb7f538c34ad07dbc49e9ee8490c87d15b53bc4a..8eea0dc203d189b4e4007dfbe8f51a23ea63ba27 100644 (file)
@@ -55,7 +55,7 @@ float server_is_dedicated;
 .float inactive; // Clientwall disappears when inactive
 .float alpha_max, alpha_min;
 .float fade_start, fade_end, fade_vertical_offset;
 .float inactive; // Clientwall disappears when inactive
 .float alpha_max, alpha_min;
 .float fade_start, fade_end, fade_vertical_offset;
-.float default_solid; // Variable to store default self.solid for clientwalls
+.float default_solid; // Variable to store default .solid for clientwalls
 
 .float pain_finished;                  //Added by Supajoe
 .float pain_frame;                     //"
 
 .float pain_finished;                  //Added by Supajoe
 .float pain_frame;                     //"
index beaf7805a28f5d3f9778707fc9996fc031455ffe..df88116d739082d8fe0065772fa43fd2228a4148 100644 (file)
@@ -1251,18 +1251,18 @@ void Fire_ApplyEffect(entity e)
 void fireburner_think(entity this)
 {
        // for players, this is done in the regular loop
 void fireburner_think(entity this)
 {
        // for players, this is done in the regular loop
-       if(wasfreed(self.owner))
+       if(wasfreed(this.owner))
        {
        {
-               remove(self);
+               remove(this);
                return;
        }
                return;
        }
-       Fire_ApplyEffect(self.owner);
-       if(!Fire_IsBurning(self.owner))
+       Fire_ApplyEffect(this.owner);
+       if(!Fire_IsBurning(this.owner))
        {
        {
-               self.owner.fire_burner = world;
-               remove(self);
+               this.owner.fire_burner = world;
+               remove(this);
                return;
        }
                return;
        }
-       Fire_ApplyDamage(self.owner);
-       self.nextthink = time;
+       Fire_ApplyDamage(this.owner);
+       this.nextthink = time;
 }
 }
index 04766c155dd89ed8cbbfc862f423217c8d6994fe..defd6051eb888d0abcbc9581cede959d251919fd 100644 (file)
@@ -49,7 +49,7 @@ const float GRAPHOOK_RELEASE          = 21;
 
 4. Open client.c and add this to the top of PutClientInServer():
 
 
 4. Open client.c and add this to the top of PutClientInServer():
 
-       RemoveGrapplingHook(self); // Wazat's Grappling Hook
+       RemoveGrapplingHook(this); // Wazat's Grappling Hook
 
 5. Find ClientConnect() (in client.c) and add these lines to the bottom:
 
 
 5. Find ClientConnect() (in client.c) and add these lines to the bottom:
 
@@ -138,40 +138,40 @@ void GrapplingHookThink(entity this)
 {
        float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
        vector dir, org, end, v0, dv, v, myorg, vs;
 {
        float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
        vector dir, org, end, v0, dv, v, myorg, vs;
-       if(self.realowner.hook != self) // how did that happen?
+       if(this.realowner.hook != this) // how did that happen?
        {
                error("Owner lost the hook!\n");
                return;
        }
        {
                error("Owner lost the hook!\n");
                return;
        }
-       if(LostMovetypeFollow(self) || intermission_running || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((self.aiment.flags & FL_PROJECTILE) && self.aiment.classname != "nade"))
+       if(LostMovetypeFollow(this) || intermission_running || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade"))
        {
        {
-               RemoveGrapplingHook(self.realowner);
+               RemoveGrapplingHook(this.realowner);
                return;
        }
                return;
        }
-       if(self.aiment)
-               WarpZone_RefSys_AddIncrementally(self, self.aiment);
+       if(this.aiment)
+               WarpZone_RefSys_AddIncrementally(this, this.aiment);
 
 
-       self.nextthink = time;
+       this.nextthink = time;
 
 
-       int s = W_GetGunAlignment(self.realowner);
+       int s = W_GetGunAlignment(this.realowner);
        vs = hook_shotorigin[s];
 
        vs = hook_shotorigin[s];
 
-       makevectors(self.realowner.v_angle);
-       org = self.realowner.origin + self.realowner.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
-       myorg = WarpZone_RefSys_TransformOrigin(self.realowner, self, org);
+       makevectors(this.realowner.v_angle);
+       org = this.realowner.origin + this.realowner.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
+       myorg = WarpZone_RefSys_TransformOrigin(this.realowner, this, org);
 
 
-       if(self.hook_length < 0)
-               self.hook_length = vlen(myorg - self.origin);
+       if(this.hook_length < 0)
+               this.hook_length = vlen(myorg - this.origin);
 
        int tarzan = autocvar_g_grappling_hook_tarzan;
 
        int tarzan = autocvar_g_grappling_hook_tarzan;
-       entity pull_entity = self.realowner;
+       entity pull_entity = this.realowner;
        float velocity_multiplier = 1;
        float velocity_multiplier = 1;
-       MUTATOR_CALLHOOK(GrappleHookThink, self, tarzan, pull_entity, velocity_multiplier);
+       MUTATOR_CALLHOOK(GrappleHookThink, this, tarzan, pull_entity, velocity_multiplier);
        tarzan = M_ARGV(1, int);
        pull_entity = M_ARGV(2, entity);
        velocity_multiplier = M_ARGV(3, float);
 
        tarzan = M_ARGV(1, int);
        pull_entity = M_ARGV(2, entity);
        velocity_multiplier = M_ARGV(3, float);
 
-       if(self.state == 1)
+       if(this.state == 1)
        {
                pullspeed = autocvar_g_balance_grapplehook_speed_pull;//2000;
                // speed the rope is pulled with
        {
                pullspeed = autocvar_g_balance_grapplehook_speed_pull;//2000;
                // speed the rope is pulled with
@@ -196,18 +196,18 @@ void GrapplingHookThink(entity this)
 
                bool frozen_pulling = (autocvar_g_grappling_hook_tarzan >= 2 && autocvar_g_balance_grapplehook_pull_frozen);
 
 
                bool frozen_pulling = (autocvar_g_grappling_hook_tarzan >= 2 && autocvar_g_balance_grapplehook_pull_frozen);
 
-               dir = self.origin - myorg;
+               dir = this.origin - myorg;
                dist = vlen(dir);
                dir = normalize(dir);
 
                if(tarzan)
                {
                dist = vlen(dir);
                dir = normalize(dir);
 
                if(tarzan)
                {
-                       v = v0 = WarpZone_RefSys_TransformVelocity(pull_entity, self, pull_entity.velocity);
+                       v = v0 = WarpZone_RefSys_TransformVelocity(pull_entity, this, pull_entity.velocity);
 
                        // first pull the rope...
 
                        // first pull the rope...
-                       if(self.realowner.hook_state & HOOK_PULLING)
+                       if(this.realowner.hook_state & HOOK_PULLING)
                        {
                        {
-                               newlength = self.hook_length;
+                               newlength = this.hook_length;
                                newlength = max(newlength - pullspeed * frametime, minlength);
 
                                if(newlength < dist - ropestretch) // overstretched?
                                newlength = max(newlength - pullspeed * frametime, minlength);
 
                                if(newlength < dist - ropestretch) // overstretched?
@@ -217,41 +217,41 @@ void GrapplingHookThink(entity this)
                                                v = v + frametime * dir * rubberforce_overstretch;
                                }
 
                                                v = v + frametime * dir * rubberforce_overstretch;
                                }
 
-                               self.hook_length = newlength;
+                               this.hook_length = newlength;
                        }
 
                        if(pull_entity.movetype == MOVETYPE_FLY)
                                pull_entity.movetype = MOVETYPE_WALK;
 
                        }
 
                        if(pull_entity.movetype == MOVETYPE_FLY)
                                pull_entity.movetype = MOVETYPE_WALK;
 
-                       if(self.realowner.hook_state & HOOK_RELEASING)
+                       if(this.realowner.hook_state & HOOK_RELEASING)
                        {
                                newlength = dist;
                        {
                                newlength = dist;
-                               self.hook_length = newlength;
+                               this.hook_length = newlength;
                        }
                        else
                        {
                                // then pull the player
                        }
                        else
                        {
                                // then pull the player
-                               spd = bound(0, (dist - self.hook_length) / ropestretch, 1);
+                               spd = bound(0, (dist - this.hook_length) / ropestretch, 1);
                                v = v * (1 - frametime * ropeairfriction);
                                v = v + frametime * dir * spd * rubberforce;
 
                                dv = ((v - v0) * dir) * dir;
                                if(tarzan >= 2)
                                {
                                v = v * (1 - frametime * ropeairfriction);
                                v = v + frametime * dir * spd * rubberforce;
 
                                dv = ((v - v0) * dir) * dir;
                                if(tarzan >= 2)
                                {
-                                       if(self.aiment.movetype == MOVETYPE_WALK || self.aiment.classname == "nade")
+                                       if(this.aiment.movetype == MOVETYPE_WALK || this.aiment.classname == "nade")
                                        {
                                        {
-                                               entity aim_ent = ((IS_VEHICLE(self.aiment) && self.aiment.owner) ? self.aiment.owner : self.aiment);
+                                               entity aim_ent = ((IS_VEHICLE(this.aiment) && this.aiment.owner) ? this.aiment.owner : this.aiment);
                                                v = v - dv * 0.5;
                                                v = v - dv * 0.5;
-                                               if((frozen_pulling && STAT(FROZEN, self.aiment)) || !frozen_pulling)
+                                               if((frozen_pulling && STAT(FROZEN, this.aiment)) || !frozen_pulling)
                                                {
                                                {
-                                                       self.aiment.velocity = self.aiment.velocity - dv * 0.5;
-                                                       UNSET_ONGROUND(self.aiment);
-                                                       if(self.aiment.flags & FL_PROJECTILE)
-                                                               UpdateCSQCProjectile(self.aiment);
+                                                       this.aiment.velocity = this.aiment.velocity - dv * 0.5;
+                                                       UNSET_ONGROUND(this.aiment);
+                                                       if(this.aiment.flags & FL_PROJECTILE)
+                                                               UpdateCSQCProjectile(this.aiment);
                                                }
                                                }
-                                               if(self.aiment.classname == "nade")
-                                                       self.aiment.nextthink = time + autocvar_g_balance_grapplehook_nade_time; // set time after letting go?
-                                               aim_ent.pusher = self.realowner;
+                                               if(this.aiment.classname == "nade")
+                                                       this.aiment.nextthink = time + autocvar_g_balance_grapplehook_nade_time; // set time after letting go?
+                                               aim_ent.pusher = this.realowner;
                                                aim_ent.pushltime = time + autocvar_g_maxpushtime;
                                                aim_ent.istypefrag = PHYS_INPUT_BUTTON_CHAT(aim_ent);
                                        }
                                                aim_ent.pushltime = time + autocvar_g_maxpushtime;
                                                aim_ent.istypefrag = PHYS_INPUT_BUTTON_CHAT(aim_ent);
                                        }
@@ -260,18 +260,18 @@ void GrapplingHookThink(entity this)
                                UNSET_ONGROUND(pull_entity);
                        }
 
                                UNSET_ONGROUND(pull_entity);
                        }
 
-                       if(!frozen_pulling && !(self.aiment.flags & FL_PROJECTILE))
-                               pull_entity.velocity = WarpZone_RefSys_TransformVelocity(self, pull_entity, v * velocity_multiplier);
+                       if(!frozen_pulling && !(this.aiment.flags & FL_PROJECTILE))
+                               pull_entity.velocity = WarpZone_RefSys_TransformVelocity(this, pull_entity, v * velocity_multiplier);
 
 
-                       if(frozen_pulling && autocvar_g_balance_grapplehook_pull_frozen == 2 && !STAT(FROZEN, self.aiment))
+                       if(frozen_pulling && autocvar_g_balance_grapplehook_pull_frozen == 2 && !STAT(FROZEN, this.aiment))
                        {
                        {
-                               RemoveGrapplingHook(self.realowner);
+                               RemoveGrapplingHook(this.realowner);
                                return;
                        }
                }
                else
                {
                                return;
                        }
                }
                else
                {
-                       end = self.origin - dir*50;
+                       end = this.origin - dir*50;
                        dist = vlen(end - myorg);
                        if(dist < 200)
                                spd = dist * (pullspeed / 200);
                        dist = vlen(end - myorg);
                        if(dist < 200)
                                spd = dist * (pullspeed / 200);
@@ -279,25 +279,25 @@ void GrapplingHookThink(entity this)
                                spd = pullspeed;
                        if(spd < 50)
                                spd = 0;
                                spd = pullspeed;
                        if(spd < 50)
                                spd = 0;
-                       self.realowner.velocity = dir*spd;
-                       self.realowner.movetype = MOVETYPE_FLY;
+                       this.realowner.velocity = dir*spd;
+                       this.realowner.movetype = MOVETYPE_FLY;
 
 
-                       UNSET_ONGROUND(self.realowner);
+                       UNSET_ONGROUND(this.realowner);
                }
        }
 
                }
        }
 
-       makevectors(self.angles.x * '-1 0 0' + self.angles.y * '0 1 0');
-       myorg = WarpZone_RefSys_TransformOrigin(self, self.realowner, self.origin); // + v_forward * (-9);
+       makevectors(this.angles.x * '-1 0 0' + this.angles.y * '0 1 0');
+       myorg = WarpZone_RefSys_TransformOrigin(this, this.realowner, this.origin); // + v_forward * (-9);
 
 
-       if(myorg != self.hook_start)
+       if(myorg != this.hook_start)
        {
        {
-               self.SendFlags |= 2;
-               self.hook_start = myorg;
+               this.SendFlags |= 2;
+               this.hook_start = myorg;
        }
        }
-       if(org != self.hook_end)
+       if(org != this.hook_end)
        {
        {
-               self.SendFlags |= 4;
-               self.hook_end = org;
+               this.SendFlags |= 4;
+               this.hook_end = org;
        }
 }
 
        }
 }
 
@@ -312,11 +312,11 @@ void GrapplingHookTouch (entity this)
        if(other)
                if(other.movetype != MOVETYPE_NONE)
                {
        if(other)
                if(other.movetype != MOVETYPE_NONE)
                {
-                       SetMovetypeFollow(self, other);
-                       WarpZone_RefSys_BeginAddingIncrementally(self, self.aiment);
+                       SetMovetypeFollow(this, other);
+                       WarpZone_RefSys_BeginAddingIncrementally(this, this.aiment);
                }
 
                }
 
-       //self.realowner.disableclientprediction = true;
+       //this.realowner.disableclientprediction = true;
 }
 
 void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 }
 
 void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
index 796af16b13e5efe2a1a0307d32a0dc34d1cf3102..9e2cd1156f6a282975b18b73bca24d041e9e6746 100644 (file)
@@ -36,50 +36,50 @@ flags:
 */
 void dynlight_think(entity this)
 {
 */
 void dynlight_think(entity this)
 {
-       if(!self.owner)
-               remove(self);
+       if(!this.owner)
+               remove(this);
 
 
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 }
 void dynlight_find_aiment(entity this)
 {
        entity targ;
 }
 void dynlight_find_aiment(entity this)
 {
        entity targ;
-       if (!self.target)
+       if (!this.target)
                objerror ("dynlight: no target to follow");
 
                objerror ("dynlight: no target to follow");
 
-       targ = find(world, targetname, self.target);
-       self.movetype = MOVETYPE_FOLLOW;
-       self.aiment = targ;
-       self.owner = targ;
-       self.punchangle = targ.angles;
-       self.view_ofs = self.origin - targ.origin;
-       self.v_angle = self.angles - targ.angles;
-       setthink(self, dynlight_think);
-       self.nextthink = time + 0.1;
+       targ = find(world, targetname, this.target);
+       this.movetype = MOVETYPE_FOLLOW;
+       this.aiment = targ;
+       this.owner = targ;
+       this.punchangle = targ.angles;
+       this.view_ofs = this.origin - targ.origin;
+       this.v_angle = this.angles - targ.angles;
+       setthink(this, dynlight_think);
+       this.nextthink = time + 0.1;
 }
 void dynlight_find_path(entity this)
 {
        entity targ;
 }
 void dynlight_find_path(entity this)
 {
        entity targ;
-       if (!self.target)
+       if (!this.target)
                objerror ("dynlight: no target to follow");
 
                objerror ("dynlight: no target to follow");
 
-       targ = find(world, targetname, self.target);
-       self.target = targ.target;
-       setorigin (self, targ.origin);
-       setthink(self, train_next);
-       self.nextthink = time + 0.1;
+       targ = find(world, targetname, this.target);
+       this.target = targ.target;
+       setorigin (this, targ.origin);
+       setthink(this, train_next);
+       this.nextthink = time + 0.1;
 }
 void dynlight_find_target(entity this)
 {
        entity targ;
 }
 void dynlight_find_target(entity this)
 {
        entity targ;
-       if (!self.target)
+       if (!this.target)
                objerror ("dynlight: no target to follow");
 
                objerror ("dynlight: no target to follow");
 
-       targ = find(world, targetname, self.target);
-       setattachment(self, targ, self.dtagname);
-       self.owner = targ;
-       setthink(self, dynlight_think);
-       self.nextthink = time + 0.1;
+       targ = find(world, targetname, this.target);
+       setattachment(this, targ, this.dtagname);
+       this.owner = targ;
+       setthink(this, dynlight_think);
+       this.nextthink = time + 0.1;
 }
 void dynlight_use(entity this, entity actor, entity trigger)
 {
 }
 void dynlight_use(entity this, entity actor, entity trigger)
 {
index 3fb232f02f58ed683fe27c22b84091a02e1bf4b5..b3b4d2eb0438d1958599a350d2682e78106c7c64 100644 (file)
@@ -414,12 +414,12 @@ void InitTrigger(entity this)
 {
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
 {
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
-       SetMovedir(self);
-       self.solid = SOLID_TRIGGER;
+       SetMovedir(this);
+       this.solid = SOLID_TRIGGER;
        SetBrushEntityModel(this);
        SetBrushEntityModel(this);
-       self.movetype = MOVETYPE_NONE;
-       self.modelindex = 0;
-       self.model = "";
+       this.movetype = MOVETYPE_NONE;
+       this.modelindex = 0;
+       this.model = "";
 }
 
 void InitSolidBSPTrigger(entity this)
 }
 
 void InitSolidBSPTrigger(entity this)
index b18cc67b5ddd26ed83d9015ed81b3f7aa4e38e88..4f9fc471f55609698c5bb490be56fcd7a1741edb 100644 (file)
@@ -11,7 +11,7 @@ spawnfunc(info_null);
 ==================
 SUB_Friction
 
 ==================
 SUB_Friction
 
-Applies some friction to self
+Applies some friction to this
 ==================
 */
 .float friction;
 ==================
 */
 .float friction;
@@ -41,8 +41,8 @@ void SUB_SetFade (entity ent, float when, float fadetime);
 =============
 SUB_CalcMove
 
 =============
 SUB_CalcMove
 
-calculate self.velocity and self.nextthink to reach dest from
-self.origin traveling at speed
+calculate this.velocity and this.nextthink to reach dest from
+this.origin traveling at speed
 ===============
 */
 void SUB_CalcMoveDone(entity this);
 ===============
 */
 void SUB_CalcMoveDone(entity this);
@@ -64,10 +64,10 @@ void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed,
 =============
 SUB_CalcAngleMove
 
 =============
 SUB_CalcAngleMove
 
-calculate self.avelocity and self.nextthink to reach destangle from
-self.angles rotating
+calculate this.avelocity and this.nextthink to reach destangle from
+this.angles rotating
 
 
-The calling function should make sure self.think is valid
+The calling function should make sure this.think is valid
 ===============
 */
 void SUB_CalcAngleMoveDone (entity this);
 ===============
 */
 void SUB_CalcAngleMoveDone (entity this);
index 0d3de4679ad1a8597199ad418585c9ac192cfd89..8e2f74c7209c150eac17a1e9b74aa5b72205e841 100644 (file)
@@ -129,11 +129,11 @@ void GotoFirstMap(entity this)
 
        if(time < 5)
        {
 
        if(time < 5)
        {
-               self.nextthink = time;
+               this.nextthink = time;
        }
        else
        {
        }
        else
        {
-               self.nextthink = time + 1;
+               this.nextthink = time + 1;
                LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...\n");
        }
 }
                LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...\n");
        }
 }
@@ -548,7 +548,7 @@ spawnfunc(__init_dedicated_server)
 
        e = new(info_player_deathmatch);  // safeguard against player joining
 
 
        e = new(info_player_deathmatch);  // safeguard against player joining
 
-       self.classname = "worldspawn"; // safeguard against various stuff ;)
+       this.classname = "worldspawn"; // safeguard against various stuff ;)
 
        // needs to be done so early because of the constants they create
        static_init();
 
        // needs to be done so early because of the constants they create
        static_init();
@@ -739,7 +739,7 @@ spawnfunc(worldspawn)
        player_count = 0;
        bot_waypoints_for_items = autocvar_g_waypoints_for_items;
        if(bot_waypoints_for_items == 1)
        player_count = 0;
        bot_waypoints_for_items = autocvar_g_waypoints_for_items;
        if(bot_waypoints_for_items == 1)
-               if(self.spawnflags & SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS)
+               if(this.spawnflags & SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS)
                        bot_waypoints_for_items = 0;
 
        precache();
                        bot_waypoints_for_items = 0;
 
        precache();
@@ -922,7 +922,7 @@ spawnfunc(worldspawn)
 
 spawnfunc(light)
 {
 
 spawnfunc(light)
 {
-       //makestatic (self); // Who the f___ did that?
+       //makestatic (this); // Who the f___ did that?
        remove(this);
 }
 
        remove(this);
 }
 
index 5de4c56a7e796260d04e69b812ba8f8ffc2320e9..8cc37597938b17bbba95d75f972935366c2ed9d0 100644 (file)
@@ -237,13 +237,13 @@ void OnlineBanList_Think(entity this)
        }
 
        if(autocvar_g_ban_sync_interval > 0)
        }
 
        if(autocvar_g_ban_sync_interval > 0)
-               self.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60);
+               this.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60);
        else
                goto killme;
        return;
 
 LABEL(killme)
        else
                goto killme;
        return;
 
 LABEL(killme)
-       remove(self);
+       remove(this);
 }
 
 const float BAN_MAX = 256;
 }
 
 const float BAN_MAX = 256;
index cbc6f94f4891dbef599c13d1f5f32054e24abc81..656eede4c9a81d34a65304533ef19e35ae1308e6 100644 (file)
@@ -74,18 +74,18 @@ void item_key_touch(entity this)
                return;
 
        // player already picked up this key
                return;
 
        // player already picked up this key
-       if (other.itemkeys & self.itemkeys)
+       if (other.itemkeys & this.itemkeys)
                return;
 
                return;
 
-       other.itemkeys |= self.itemkeys;
-       play2(other, self.noise);
+       other.itemkeys |= this.itemkeys;
+       play2(other, this.noise);
 
 
-       centerprint(other, self.message);
+       centerprint(other, this.message);
 
 
-       string oldmsg = self.message;
-       self.message = "";
-       SUB_UseTargets(self, other, other); // TODO: should we be using other for the trigger here?
-       self.message = oldmsg;
+       string oldmsg = this.message;
+       this.message = "";
+       SUB_UseTargets(this, other, other); // TODO: should we be using other for the trigger here?
+       this.message = oldmsg;
 };
 
 /**
 };
 
 /**
index 1e2cd69eee2cbbbfb03522e97b03f619cea6fbad..44c21610a09f7efcf4f66c9b781c8aa6de0b040b 100644 (file)
@@ -442,9 +442,9 @@ void GetCvars(entity this, int f)
        if (f > 0)
        {
                if (s == "cl_weaponpriority")
        if (f > 0)
        {
                if (s == "cl_weaponpriority")
-                       if (PS(self)) PS(self).m_switchweapon = w_getbestweapon(self);
+                       if (PS(this)) PS(this).m_switchweapon = w_getbestweapon(this);
                if (s == "cl_allow_uidtracking")
                if (s == "cl_allow_uidtracking")
-                       PlayerStats_GameReport_AddPlayer(self);
+                       PlayerStats_GameReport_AddPlayer(this);
        }
 }
 
        }
 }
 
@@ -779,14 +779,14 @@ void precache()
 #if 0
     // Disabled this code because it simply does not work (e.g. ignores bgmvolume, overlaps with "cd loop" controlled tracks).
 
 #if 0
     // Disabled this code because it simply does not work (e.g. ignores bgmvolume, overlaps with "cd loop" controlled tracks).
 
-    if (!self.noise && self.music) // quake 3 uses the music field
-        self.noise = self.music;
+    if (!this.noise && this.music) // quake 3 uses the music field
+        this.noise = this.music;
 
     // plays music for the level if there is any
 
     // plays music for the level if there is any
-    if (self.noise)
+    if (this.noise)
     {
     {
-        precache_sound (self.noise);
-        ambientsound ('0 0 0', self.noise, VOL_BASE, ATTEN_NONE);
+        precache_sound (this.noise);
+        ambientsound ('0 0 0', this.noise, VOL_BASE, ATTEN_NONE);
     }
 #endif
 }
     }
 #endif
 }
@@ -825,7 +825,7 @@ void make_safe_for_remove(entity e)
 
 void objerror(string s)
 {SELFPARAM(); // needed for engine functions
 
 void objerror(string s)
 {SELFPARAM(); // needed for engine functions
-    make_safe_for_remove(self);
+    make_safe_for_remove(this);
     builtin_objerror(s);
 }
 
     builtin_objerror(s);
 }
 
index a7b3daca0514092fd4ca60d27c7180571026a0ba..ec2176b335679c5daef0fc178cfe62c887c09992 100644 (file)
@@ -98,7 +98,7 @@ MUTATOR_HOOKABLE(MatchEnd, EV_NO_ARGS);
     /**/
 MUTATOR_HOOKABLE(GetTeamCount, EV_GetTeamCount);
 
     /**/
 MUTATOR_HOOKABLE(GetTeamCount, EV_GetTeamCount);
 
-/** copies variables for spectating "other" to "self" */
+/** copies variables for spectating "spectatee" to "this" */
 #define EV_SpectateCopy(i, o) \
     /** spectatee   */ i(entity, MUTATOR_ARGV_0_entity) \
     /** client      */ i(entity, MUTATOR_ARGV_1_entity) \
 #define EV_SpectateCopy(i, o) \
     /** spectatee   */ i(entity, MUTATOR_ARGV_0_entity) \
     /** client      */ i(entity, MUTATOR_ARGV_1_entity) \
@@ -157,7 +157,7 @@ MUTATOR_HOOKABLE(SetStartItems, EV_NO_ARGS);
 MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
 
 /**
 MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
 
 /**
- * checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
+ * checks if the current item may be spawned (.items and .weapons may be read and written to, as well as the ammo_ fields)
  * return error to request removal
  */
 #define EV_FilterItem(i, o) \
  * return error to request removal
  */
 #define EV_FilterItem(i, o) \
@@ -487,7 +487,7 @@ MUTATOR_HOOKABLE(PortalTeleport, EV_PortalTeleport);
 
 /**
  * called whenever a player uses impulse 33 (help me) in cl_impulse.qc
 
 /**
  * called whenever a player uses impulse 33 (help me) in cl_impulse.qc
- * normally help me ping uses self.waypointsprite_attachedforcarrier,
+ * normally help me ping uses .waypointsprite_attachedforcarrier,
  * but if your mutator uses something different then you can handle it
  * in a special manner using this hook
  */
  * but if your mutator uses something different then you can handle it
  * in a special manner using this hook
  */
index 7c32b077ab87d70ae69cf83983b7eb562383fe81..701ff1670f386fae04834d51f20d6fc57b45f95d 100644 (file)
@@ -235,18 +235,18 @@ void assault_roundstart_use_this(entity this)
 
 void assault_wall_think(entity this)
 {
 
 void assault_wall_think(entity this)
 {
-       if(self.enemy.health < 0)
+       if(this.enemy.health < 0)
        {
        {
-               self.model = "";
-               self.solid = SOLID_NOT;
+               this.model = "";
+               this.solid = SOLID_NOT;
        }
        else
        {
        }
        else
        {
-               self.model = self.mdl;
-               self.solid = SOLID_BSP;
+               this.model = this.mdl;
+               this.solid = SOLID_BSP;
        }
 
        }
 
-       self.nextthink = time + 0.2;
+       this.nextthink = time + 0.2;
 }
 
 // trigger new round
 }
 
 // trigger new round
index fe63fa7e4ec2fb023a922f9c3793d2ca086c645a..b827f10eaeab295201970fa34297e5115dfce578 100644 (file)
@@ -281,7 +281,7 @@ void ctf_CaptureShield_Update(entity player, bool wanted_status)
 bool ctf_CaptureShield_Customize(entity this)
 {
        if(!other.ctf_captureshielded) { return false; }
 bool ctf_CaptureShield_Customize(entity this)
 {
        if(!other.ctf_captureshielded) { return false; }
-       if(CTF_SAMETEAM(self, other)) { return false; }
+       if(CTF_SAMETEAM(this, other)) { return false; }
 
        return true;
 }
 
        return true;
 }
@@ -289,12 +289,12 @@ bool ctf_CaptureShield_Customize(entity this)
 void ctf_CaptureShield_Touch(entity this)
 {
        if(!other.ctf_captureshielded) { return; }
 void ctf_CaptureShield_Touch(entity this)
 {
        if(!other.ctf_captureshielded) { return; }
-       if(CTF_SAMETEAM(self, other)) { return; }
+       if(CTF_SAMETEAM(this, other)) { return; }
 
 
-       vector mymid = (self.absmin + self.absmax) * 0.5;
+       vector mymid = (this.absmin + this.absmax) * 0.5;
        vector othermid = (other.absmin + other.absmax) * 0.5;
 
        vector othermid = (other.absmin + other.absmax) * 0.5;
 
-       Damage(other, self, self, 0, DEATH_HURTTRIGGER.m_id, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
+       Damage(other, this, this, 0, DEATH_HURTTRIGGER.m_id, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
        if(IS_REAL_CLIENT(other)) { Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED); }
 }
 
        if(IS_REAL_CLIENT(other)) { Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED); }
 }
 
@@ -752,7 +752,7 @@ bool ctf_Stalemate_Customize(entity this)
        // make spectators see what the player would see
        entity e, wp_owner;
        e = WaypointSprite_getviewentity(other);
        // make spectators see what the player would see
        entity e, wp_owner;
        e = WaypointSprite_getviewentity(other);
-       wp_owner = self.owner;
+       wp_owner = this.owner;
 
        // team waypoints
        if(CTF_SAMETEAM(wp_owner.flagcarried, wp_owner)) { return false; }
 
        // team waypoints
        if(CTF_SAMETEAM(wp_owner.flagcarried, wp_owner)) { return false; }
@@ -856,24 +856,24 @@ void ctf_FlagThink(entity this)
        // declarations
        entity tmp_entity;
 
        // declarations
        entity tmp_entity;
 
-       self.nextthink = time + FLAG_THINKRATE; // only 5 fps, more is unnecessary.
+       this.nextthink = time + FLAG_THINKRATE; // only 5 fps, more is unnecessary.
 
        // captureshield
 
        // captureshield
-       if(self == ctf_worldflaglist) // only for the first flag
+       if(this == ctf_worldflaglist) // only for the first flag
                FOREACH_CLIENT(true, LAMBDA(ctf_CaptureShield_Update(it, 1))); // release shield only
 
        // sanity checks
                FOREACH_CLIENT(true, LAMBDA(ctf_CaptureShield_Update(it, 1))); // release shield only
 
        // sanity checks
-       if(self.mins != CTF_FLAG.m_mins || self.maxs != CTF_FLAG.m_maxs) { // reset the flag boundaries in case it got squished
+       if(this.mins != CTF_FLAG.m_mins || this.maxs != CTF_FLAG.m_maxs) { // reset the flag boundaries in case it got squished
                LOG_TRACE("wtf the flag got squashed?\n");
                LOG_TRACE("wtf the flag got squashed?\n");
-               tracebox(self.origin, CTF_FLAG.m_mins, CTF_FLAG.m_maxs, self.origin, MOVE_NOMONSTERS, self);
-               if(!trace_startsolid || self.noalign) // can we resize it without getting stuck?
-                       setsize(self, CTF_FLAG.m_mins, CTF_FLAG.m_maxs); }
+               tracebox(this.origin, CTF_FLAG.m_mins, CTF_FLAG.m_maxs, this.origin, MOVE_NOMONSTERS, this);
+               if(!trace_startsolid || this.noalign) // can we resize it without getting stuck?
+                       setsize(this, CTF_FLAG.m_mins, CTF_FLAG.m_maxs); }
 
 
-       switch(self.ctf_status) // reset flag angles in case warpzones adjust it
+       switch(this.ctf_status) // reset flag angles in case warpzones adjust it
        {
                case FLAG_DROPPED:
                {
        {
                case FLAG_DROPPED:
                {
-                       self.angles = '0 0 0';
+                       this.angles = '0 0 0';
                        break;
                }
 
                        break;
                }
 
@@ -881,7 +881,7 @@ void ctf_FlagThink(entity this)
        }
 
        // main think method
        }
 
        // main think method
-       switch(self.ctf_status)
+       switch(this.ctf_status)
        {
                case FLAG_BASE:
                {
        {
                case FLAG_BASE:
                {
@@ -889,9 +889,9 @@ void ctf_FlagThink(entity this)
                        {
                                for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
                                        if(tmp_entity.ctf_status == FLAG_DROPPED)
                        {
                                for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
                                        if(tmp_entity.ctf_status == FLAG_DROPPED)
-                                       if(vlen(self.origin - tmp_entity.origin) < autocvar_g_ctf_dropped_capture_radius)
+                                       if(vdist(this.origin - tmp_entity.origin, <, autocvar_g_ctf_dropped_capture_radius))
                                        if(time > tmp_entity.ctf_droptime + autocvar_g_ctf_dropped_capture_delay)
                                        if(time > tmp_entity.ctf_droptime + autocvar_g_ctf_dropped_capture_delay)
-                                               ctf_Handle_Capture(self, tmp_entity, CAPTURE_DROPPED);
+                                               ctf_Handle_Capture(this, tmp_entity, CAPTURE_DROPPED);
                        }
                        return;
                }
                        }
                        return;
                }
@@ -900,37 +900,37 @@ void ctf_FlagThink(entity this)
                {
                        if(autocvar_g_ctf_flag_dropped_floatinwater)
                        {
                {
                        if(autocvar_g_ctf_flag_dropped_floatinwater)
                        {
-                               vector midpoint = ((self.absmin + self.absmax) * 0.5);
+                               vector midpoint = ((this.absmin + this.absmax) * 0.5);
                                if(pointcontents(midpoint) == CONTENT_WATER)
                                {
                                if(pointcontents(midpoint) == CONTENT_WATER)
                                {
-                                       self.velocity = self.velocity * 0.5;
+                                       this.velocity = this.velocity * 0.5;
 
                                        if(pointcontents(midpoint + FLAG_FLOAT_OFFSET) == CONTENT_WATER)
 
                                        if(pointcontents(midpoint + FLAG_FLOAT_OFFSET) == CONTENT_WATER)
-                                               { self.velocity_z = autocvar_g_ctf_flag_dropped_floatinwater; }
+                                               { this.velocity_z = autocvar_g_ctf_flag_dropped_floatinwater; }
                                        else
                                        else
-                                               { self.movetype = MOVETYPE_FLY; }
+                                               { this.movetype = MOVETYPE_FLY; }
                                }
                                }
-                               else if(self.movetype == MOVETYPE_FLY) { self.movetype = MOVETYPE_TOSS; }
+                               else if(this.movetype == MOVETYPE_FLY) { this.movetype = MOVETYPE_TOSS; }
                        }
                        if(autocvar_g_ctf_flag_return_dropped)
                        {
                        }
                        if(autocvar_g_ctf_flag_return_dropped)
                        {
-                               if((vlen(self.origin - self.ctf_spawnorigin) <= autocvar_g_ctf_flag_return_dropped) || (autocvar_g_ctf_flag_return_dropped == -1))
+                               if((vdist(this.origin - this.ctf_spawnorigin, <=, autocvar_g_ctf_flag_return_dropped)) || (autocvar_g_ctf_flag_return_dropped == -1))
                                {
                                {
-                                       self.health = 0;
-                                       ctf_CheckFlagReturn(self, RETURN_DROPPED);
+                                       this.health = 0;
+                                       ctf_CheckFlagReturn(this, RETURN_DROPPED);
                                        return;
                                }
                        }
                                        return;
                                }
                        }
-                       if(self.ctf_flagdamaged)
+                       if(this.ctf_flagdamaged)
                        {
                        {
-                               self.health -= ((self.max_flag_health / autocvar_g_ctf_flag_return_damage_delay) * FLAG_THINKRATE);
-                               ctf_CheckFlagReturn(self, RETURN_NEEDKILL);
+                               this.health -= ((this.max_flag_health / autocvar_g_ctf_flag_return_damage_delay) * FLAG_THINKRATE);
+                               ctf_CheckFlagReturn(this, RETURN_NEEDKILL);
                                return;
                        }
                        else if(autocvar_g_ctf_flag_return_time)
                        {
                                return;
                        }
                        else if(autocvar_g_ctf_flag_return_time)
                        {
-                               self.health -= ((self.max_flag_health / autocvar_g_ctf_flag_return_time) * FLAG_THINKRATE);
-                               ctf_CheckFlagReturn(self, RETURN_TIMEOUT);
+                               this.health -= ((this.max_flag_health / autocvar_g_ctf_flag_return_time) * FLAG_THINKRATE);
+                               ctf_CheckFlagReturn(this, RETURN_TIMEOUT);
                                return;
                        }
                        return;
                                return;
                        }
                        return;
@@ -938,13 +938,13 @@ void ctf_FlagThink(entity this)
 
                case FLAG_CARRY:
                {
 
                case FLAG_CARRY:
                {
-                       if(self.speedrunning && ctf_captimerecord && (time >= self.ctf_pickuptime + ctf_captimerecord))
+                       if(this.speedrunning && ctf_captimerecord && (time >= this.ctf_pickuptime + ctf_captimerecord))
                        {
                        {
-                               self.health = 0;
-                               ctf_CheckFlagReturn(self, RETURN_SPEEDRUN);
+                               this.health = 0;
+                               ctf_CheckFlagReturn(this, RETURN_SPEEDRUN);
 
 
-                               self.owner.impulse = CHIMPULSE_SPEEDRUN.impulse; // move the player back to the waypoint they set
-                               ImpulseCommands(self.owner);
+                               this.owner.impulse = CHIMPULSE_SPEEDRUN.impulse; // move the player back to the waypoint they set
+                               ImpulseCommands(this.owner);
                        }
                        if(autocvar_g_ctf_stalemate)
                        {
                        }
                        if(autocvar_g_ctf_stalemate)
                        {
@@ -954,36 +954,36 @@ void ctf_FlagThink(entity this)
                                        wpforenemy_nextthink = time + WPFE_THINKRATE; // waypoint for enemy think rate (to reduce unnecessary spam of this check)
                                }
                        }
                                        wpforenemy_nextthink = time + WPFE_THINKRATE; // waypoint for enemy think rate (to reduce unnecessary spam of this check)
                                }
                        }
-                       if(CTF_SAMETEAM(self, self.owner) && self.team)
+                       if(CTF_SAMETEAM(this, this.owner) && this.team)
                        {
                                if(autocvar_g_ctf_flag_return) // drop the flag if reverse status has changed
                        {
                                if(autocvar_g_ctf_flag_return) // drop the flag if reverse status has changed
-                                       ctf_Handle_Throw(self.owner, world, DROP_THROW);
-                               else if(vlen(self.owner.origin - self.ctf_spawnorigin) <= autocvar_g_ctf_flag_return_carried_radius)
-                                       ctf_Handle_Return(self, self.owner);
+                                       ctf_Handle_Throw(this.owner, world, DROP_THROW);
+                               else if(vdist(this.owner.origin - this.ctf_spawnorigin, <=, autocvar_g_ctf_flag_return_carried_radius))
+                                       ctf_Handle_Return(this, this.owner);
                        }
                        return;
                }
 
                case FLAG_PASSING:
                {
                        }
                        return;
                }
 
                case FLAG_PASSING:
                {
-                       vector targ_origin = ((self.pass_target.absmin + self.pass_target.absmax) * 0.5);
-                       targ_origin = WarpZone_RefSys_TransformOrigin(self.pass_target, self, targ_origin); // origin of target as seen by the flag (us)
-                       WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self);
-
-                       if((self.pass_target == world)
-                               || (IS_DEAD(self.pass_target))
-                               || (self.pass_target.flagcarried)
-                               || (vlen(self.origin - targ_origin) > autocvar_g_ctf_pass_radius)
-                               || ((trace_fraction < 1) && (trace_ent != self.pass_target))
-                               || (time > self.ctf_droptime + autocvar_g_ctf_pass_timelimit))
+                       vector targ_origin = ((this.pass_target.absmin + this.pass_target.absmax) * 0.5);
+                       targ_origin = WarpZone_RefSys_TransformOrigin(this.pass_target, this, targ_origin); // origin of target as seen by the flag (us)
+                       WarpZone_TraceLine(this.origin, targ_origin, MOVE_NOMONSTERS, this);
+
+                       if((this.pass_target == world)
+                               || (IS_DEAD(this.pass_target))
+                               || (this.pass_target.flagcarried)
+                               || (vdist(this.origin - targ_origin, <, autocvar_g_ctf_pass_radius))
+                               || ((trace_fraction < 1) && (trace_ent != this.pass_target))
+                               || (time > this.ctf_droptime + autocvar_g_ctf_pass_timelimit))
                        {
                                // give up, pass failed
                        {
                                // give up, pass failed
-                               ctf_Handle_Drop(self, world, DROP_PASS);
+                               ctf_Handle_Drop(this, world, DROP_PASS);
                        }
                        else
                        {
                                // still a viable target, go for it
                        }
                        else
                        {
                                // still a viable target, go for it
-                               ctf_CalculatePassVelocity(self, targ_origin, self.origin, true);
+                               ctf_CalculatePassVelocity(this, targ_origin, this.origin, true);
                        }
                        return;
                }
                        }
                        return;
                }
@@ -1370,7 +1370,7 @@ int havocbot_ctf_teamcount(entity bot, vector org, float tc_radius)
                if(DIFF_TEAM(it, bot) || IS_DEAD(it) || it == bot)
                        continue;
 
                if(DIFF_TEAM(it, bot) || IS_DEAD(it) || it == bot)
                        continue;
 
-               if(vlen(it.origin - org) < tc_radius)
+               if(vdist(it.origin - org, <, tc_radius))
                        ++c;
        ));
 
                        ++c;
        ));
 
@@ -1477,11 +1477,11 @@ void havocbot_goalrating_ctf_droppedflags(entity this, float ratingscale, vector
                {
                        if(df_radius)
                        {
                {
                        if(df_radius)
                        {
-                               if(vlen(org-head.origin)<df_radius)
-                                       navigation_routerating(self, head, ratingscale, 10000);
+                               if(vdist(org - head.origin, <, df_radius))
+                                       navigation_routerating(this, head, ratingscale, 10000);
                        }
                        else
                        }
                        else
-                               navigation_routerating(self, head, ratingscale, 10000);
+                               navigation_routerating(this, head, ratingscale, 10000);
                }
 
                head = head.ctf_worldflagnext;
                }
 
                head = head.ctf_worldflagnext;
@@ -1498,7 +1498,7 @@ void havocbot_goalrating_ctf_carrieritems(entity this, float ratingscale, vector
                // gather health and armor only
                if (head.solid)
                if (head.health || head.armorvalue)
                // gather health and armor only
                if (head.solid)
                if (head.health || head.armorvalue)
-               if (vlen(head.origin - org) < sradius)
+               if (vdist(head.origin - org, <, sradius))
                {
                        // get the value of the item
                        t = head.bot_pickupevalfunc(this, head) * 0.0001;
                {
                        // get the value of the item
                        t = head.bot_pickupevalfunc(this, head) * 0.0001;
@@ -1642,7 +1642,7 @@ void havocbot_role_ctf_escort(entity this)
        // If the flag carrier reached the base switch to defense
        mf = havocbot_ctf_find_flag(this);
        if(mf.ctf_status!=FLAG_BASE)
        // If the flag carrier reached the base switch to defense
        mf = havocbot_ctf_find_flag(this);
        if(mf.ctf_status!=FLAG_BASE)
-       if(vlen(ef.origin - mf.dropped_origin) < 300)
+       if(vdist(ef.origin - mf.dropped_origin, <, 300))
        {
                havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_DEFENSE);
                return;
        {
                havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_DEFENSE);
                return;
@@ -1704,7 +1704,7 @@ void havocbot_role_ctf_offense(entity this)
                        pos = mf.origin;
 
                // Try to get it if closer than the enemy base
                        pos = mf.origin;
 
                // Try to get it if closer than the enemy base
-               if(vlen(this.origin-ef.dropped_origin)>vlen(this.origin-pos))
+               if(vlen2(this.origin-ef.dropped_origin)>vlen2(this.origin-pos))
                {
                        havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_RETRIEVER);
                        return;
                {
                        havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_RETRIEVER);
                        return;
@@ -1719,7 +1719,7 @@ void havocbot_role_ctf_offense(entity this)
                else
                        pos = ef.origin;
 
                else
                        pos = ef.origin;
 
-               if(vlen(pos-mf.dropped_origin)>700)
+               if(vdist(pos - mf.dropped_origin, >, 700))
                {
                        havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_ESCORT);
                        return;
                {
                        havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_ESCORT);
                        return;
@@ -1912,7 +1912,7 @@ void havocbot_role_ctf_defense(entity this)
 
                if(closestplayer)
                if(DIFF_TEAM(closestplayer, this))
 
                if(closestplayer)
                if(DIFF_TEAM(closestplayer, this))
-               if(vlen(org - this.origin)>1000)
+               if(vdist(org - this.origin, >, 1000))
                if(checkpvs(this.origin,closestplayer)||random()<0.5)
                        havocbot_goalrating_ctf_ourbase(this, 30000);
 
                if(checkpvs(this.origin,closestplayer)||random()<0.5)
                        havocbot_goalrating_ctf_ourbase(this, 30000);
 
@@ -2168,7 +2168,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey)
                                                        if(closest_target)
                                                        {
                                                                vector closest_target_center = WarpZone_UnTransformOrigin(closest_target, CENTER_OR_VIEWOFS(closest_target));
                                                        if(closest_target)
                                                        {
                                                                vector closest_target_center = WarpZone_UnTransformOrigin(closest_target, CENTER_OR_VIEWOFS(closest_target));
-                                                               if(vlen(passer_center - head_center) < vlen(passer_center - closest_target_center))
+                                                               if(vlen2(passer_center - head_center) < vlen2(passer_center - closest_target_center))
                                                                        { closest_target = head; }
                                                        }
                                                        else { closest_target = head; }
                                                                        { closest_target = head; }
                                                        }
                                                        else { closest_target = head; }
index 3a6a77df596fae5280e14b8aa3facee9b924fff9..3264c7b2cdfb816c90fafe61375327ffa88d049d 100644 (file)
@@ -86,78 +86,78 @@ void ka_RespawnBall(entity this);
 void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
 {
        if(gameover) { return; }
 void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
 {
        if(gameover) { return; }
-       vector oldballorigin = self.origin;
+       vector oldballorigin = this.origin;
 
 
-       if(!MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
+       if(!MoveToRandomMapLocation(this, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
        {
                entity spot = SelectSpawnPoint(this, true);
        {
                entity spot = SelectSpawnPoint(this, true);
-               setorigin(self, spot.origin);
-               self.angles = spot.angles;
+               setorigin(this, spot.origin);
+               this.angles = spot.angles;
        }
 
        }
 
-       makevectors(self.angles);
-       self.movetype = MOVETYPE_BOUNCE;
-       self.velocity = '0 0 200';
-       self.angles = '0 0 0';
-       self.effects = autocvar_g_keepawayball_effects;
-       settouch(self, ka_TouchEvent);
-       setthink(self, ka_RespawnBall);
-       self.nextthink = time + autocvar_g_keepawayball_respawntime;
+       makevectors(this.angles);
+       this.movetype = MOVETYPE_BOUNCE;
+       this.velocity = '0 0 200';
+       this.angles = '0 0 0';
+       this.effects = autocvar_g_keepawayball_effects;
+       settouch(this, ka_TouchEvent);
+       setthink(this, ka_RespawnBall);
+       this.nextthink = time + autocvar_g_keepawayball_respawntime;
 
        Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
 
        Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
-       Send_Effect(EFFECT_ELECTRO_COMBO, self.origin, '0 0 0', 1);
+       Send_Effect(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 1);
 
 
-       WaypointSprite_Spawn(WP_KaBall, 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
-       WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
+       WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', world, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
+       WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
 
 
-       sound(self, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
+       sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 }
 
 void ka_TimeScoring(entity this)
 {
 }
 
 void ka_TimeScoring(entity this)
 {
-       if(self.owner.ballcarried)
+       if(this.owner.ballcarried)
        { // add points for holding the ball after a certain amount of time
                if(autocvar_g_keepaway_score_timepoints)
        { // add points for holding the ball after a certain amount of time
                if(autocvar_g_keepaway_score_timepoints)
-                       PlayerScore_Add(self.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
+                       PlayerScore_Add(this.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
 
 
-               PlayerScore_Add(self.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
-               self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
+               PlayerScore_Add(this.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
+               this.nextthink = time + autocvar_g_keepaway_score_timeinterval;
        }
 }
 
 void ka_TouchEvent(entity this) // runs any time that the ball comes in contact with something
 {
        if(gameover) { return; }
        }
 }
 
 void ka_TouchEvent(entity this) // runs any time that the ball comes in contact with something
 {
        if(gameover) { return; }
-       if(!self) { return; }
+       if(!this) { return; }
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        { // The ball fell off the map, respawn it since players can't get to it
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        { // The ball fell off the map, respawn it since players can't get to it
-               ka_RespawnBall(self);
+               ka_RespawnBall(this);
                return;
        }
        if(IS_DEAD(other)) { return; }
        if(STAT(FROZEN, other)) { return; }
        if (!IS_PLAYER(other))
        {  // The ball just touched an object, most likely the world
                return;
        }
        if(IS_DEAD(other)) { return; }
        if(STAT(FROZEN, other)) { return; }
        if (!IS_PLAYER(other))
        {  // The ball just touched an object, most likely the world
-               Send_Effect(EFFECT_BALL_SPARKS, self.origin, '0 0 0', 1);
-               sound(self, CH_TRIGGER, SND_KA_TOUCH, VOL_BASE, ATTEN_NORM);
+               Send_Effect(EFFECT_BALL_SPARKS, this.origin, '0 0 0', 1);
+               sound(this, CH_TRIGGER, SND_KA_TOUCH, VOL_BASE, ATTEN_NORM);
                return;
        }
                return;
        }
-       else if(self.wait > time) { return; }
+       else if(this.wait > time) { return; }
 
        // attach the ball to the player
 
        // attach the ball to the player
-       self.owner = other;
-       other.ballcarried = self;
-       setattachment(self, other, "");
-       setorigin(self, '0 0 0');
+       this.owner = other;
+       other.ballcarried = this;
+       setattachment(this, other, "");
+       setorigin(this, '0 0 0');
 
        // make the ball invisible/unable to do anything/set up time scoring
 
        // make the ball invisible/unable to do anything/set up time scoring
-       self.velocity = '0 0 0';
-       self.movetype = MOVETYPE_NONE;
-       self.effects |= EF_NODRAW;
-       settouch(self, func_null);
-       setthink(self, ka_TimeScoring);
-       self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
-       self.takedamage = DAMAGE_NO;
+       this.velocity = '0 0 0';
+       this.movetype = MOVETYPE_NONE;
+       this.effects |= EF_NODRAW;
+       settouch(this, func_null);
+       setthink(this, ka_TimeScoring);
+       this.nextthink = time + autocvar_g_keepaway_score_timeinterval;
+       this.takedamage = DAMAGE_NO;
 
        // apply effects to player
        other.glow_color = autocvar_g_keepawayball_trail_color;
 
        // apply effects to player
        other.glow_color = autocvar_g_keepawayball_trail_color;
@@ -169,7 +169,7 @@ void ka_TouchEvent(entity this) // runs any time that the ball comes in contact
        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
        Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
        Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF);
        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
        Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
        Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF);
-       sound(self.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
+       sound(this.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 
        // scoring
        PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
 
        // scoring
        PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
@@ -179,7 +179,7 @@ void ka_TouchEvent(entity this) // runs any time that the ball comes in contact
        other.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = ka_ballcarrier_waypointsprite_visible_for_player;
        WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
        WaypointSprite_Ping(other.waypointsprite_attachedforcarrier);
        other.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = ka_ballcarrier_waypointsprite_visible_for_player;
        WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
        WaypointSprite_Ping(other.waypointsprite_attachedforcarrier);
-       WaypointSprite_Kill(self.waypointsprite_attachedforcarrier);
+       WaypointSprite_Kill(this.waypointsprite_attachedforcarrier);
 }
 
 void ka_DropEvent(entity plyr) // runs any time that a player is supposed to lose the ball
 }
 
 void ka_DropEvent(entity plyr) // runs any time that a player is supposed to lose the ball
index 30653641f49ec17ecf4aff870b3ed07b92162221..6bb53b7c5925e38f2d4bf3f8c65c526133e53273 100644 (file)
@@ -219,14 +219,14 @@ void kh_Controller_Think(entity this)  // called a lot
 {
        if(intermission_running)
                return;
 {
        if(intermission_running)
                return;
-       if(self.cnt > 0)
-       { if(getthink(self) != kh_WaitForPlayers) { self.cnt -= 1; } }
-       else if(self.cnt == 0)
+       if(this.cnt > 0)
+       { if(getthink(this) != kh_WaitForPlayers) { this.cnt -= 1; } }
+       else if(this.cnt == 0)
        {
        {
-               self.cnt -= 1;
+               this.cnt -= 1;
                kh_Controller_Thinkfunc();
        }
                kh_Controller_Thinkfunc();
        }
-       self.nextthink = time + 1;
+       this.nextthink = time + 1;
 }
 
 // frags f: take from cvar * f
 }
 
 // frags f: take from cvar * f
@@ -510,7 +510,7 @@ void kh_Key_Touch(entity this)  // runs many, many times when a key has been dro
        if(intermission_running)
                return;
 
        if(intermission_running)
                return;
 
-       if(self.owner) // already carried
+       if(this.owner) // already carried
                return;
 
        if(ITEM_TOUCH_NEEDKILL())
                return;
 
        if(ITEM_TOUCH_NEEDKILL())
@@ -525,10 +525,10 @@ void kh_Key_Touch(entity this)  // runs many, many times when a key has been dro
                return;
        if(IS_DEAD(other))
                return;
                return;
        if(IS_DEAD(other))
                return;
-       if(other == self.enemy)
-               if(time < self.kh_droptime + autocvar_g_balance_keyhunt_delay_collect)
+       if(other == this.enemy)
+               if(time < this.kh_droptime + autocvar_g_balance_keyhunt_delay_collect)
                        return;  // you just dropped it!
                        return;  // you just dropped it!
-       kh_Key_Collect(self, other);
+       kh_Key_Collect(this, other);
 }
 
 void kh_Key_Remove(entity key)  // runs after when all the keys have been collected or when a key has been dropped for more than X seconds
 }
 
 void kh_Key_Remove(entity key)  // runs after when all the keys have been collected or when a key has been dropped for more than X seconds
@@ -731,35 +731,35 @@ void kh_Key_Think(entity this)  // runs all the time
        if(intermission_running)
                return;
 
        if(intermission_running)
                return;
 
-       if(self.owner)
+       if(this.owner)
        {
 #ifndef KH_PLAYER_USE_ATTACHMENT
        {
 #ifndef KH_PLAYER_USE_ATTACHMENT
-               makevectors('0 1 0' * (self.cnt + (time % 360) * KH_KEY_XYSPEED));
-               setorigin(self, v_forward * KH_KEY_XYDIST + '0 0 1' * self.origin.z);
+               makevectors('0 1 0' * (this.cnt + (time % 360) * KH_KEY_XYSPEED));
+               setorigin(this, v_forward * KH_KEY_XYDIST + '0 0 1' * this.origin.z);
 #endif
        }
 
        // if in nodrop or time over, end the round
 #endif
        }
 
        // if in nodrop or time over, end the round
-       if(!self.owner)
-               if(time > self.pain_finished)
-                       kh_LoserTeam(self.team, self);
+       if(!this.owner)
+               if(time > this.pain_finished)
+                       kh_LoserTeam(this.team, this);
 
 
-       if(self.owner)
+       if(this.owner)
        if(kh_Key_AllOwnedByWhichTeam() != -1)
        {
        if(kh_Key_AllOwnedByWhichTeam() != -1)
        {
-               if(self.siren_time < time)
+               if(this.siren_time < time)
                {
                {
-                       sound(self.owner, CH_TRIGGER, SND_KH_ALARM, VOL_BASE, ATTEN_NORM);  // play a simple alarm
-                       self.siren_time = time + 2.5;  // repeat every 2.5 seconds
+                       sound(this.owner, CH_TRIGGER, SND_KH_ALARM, VOL_BASE, ATTEN_NORM);  // play a simple alarm
+                       this.siren_time = time + 2.5;  // repeat every 2.5 seconds
                }
 
                entity key;
                vector p;
                }
 
                entity key;
                vector p;
-               p = self.owner.origin;
+               p = this.owner.origin;
                FOR_EACH_KH_KEY(key)
                FOR_EACH_KH_KEY(key)
-                       if(vlen(key.owner.origin - p) > autocvar_g_balance_keyhunt_maxdist)
+                       if(vdist(key.owner.origin - p, >, autocvar_g_balance_keyhunt_maxdist))
                                goto not_winning;
                                goto not_winning;
-               kh_WinnerTeam(self.team);
+               kh_WinnerTeam(this.team);
 LABEL(not_winning)
        }
 
 LABEL(not_winning)
        }
 
@@ -777,7 +777,7 @@ LABEL(not_winning)
                ));
        }
 
                ));
        }
 
-       self.nextthink = time + 0.05;
+       this.nextthink = time + 0.05;
 }
 
 void key_reset(entity this)
 }
 
 void key_reset(entity this)
index 09b81724ec1168ac49046317fb873c9c18e06f85..bd1295172a5df4a7f8ff22dd4fd924464b401670 100644 (file)
@@ -32,17 +32,17 @@ void path_dbg_think(entity this)
 void __showpath2_think(entity this)
 {
     #ifdef TURRET_DEBUG
 void __showpath2_think(entity this)
 {
     #ifdef TURRET_DEBUG
-       mark_info(self.origin,1);
+       mark_info(this.origin,1);
        #endif
        #endif
-    if(self.path_next)
+    if(this.path_next)
     {
     {
-        setthink(self.path_next, __showpath2_think);
-        self.path_next.nextthink = time + 0.15;
+        setthink(this.path_next, __showpath2_think);
+        this.path_next.nextthink = time + 0.15;
     }
     else
     {
     }
     else
     {
-        setthink(self.owner, __showpath2_think);
-        self.owner.nextthink = time + 0.15;
+        setthink(this.owner, __showpath2_think);
+        this.owner.nextthink = time + 0.15;
     }
 }
 
     }
 }
 
index 6fc5cf712a1cdd572d091781a74f5228ac34a0f0..f729137a61542fd61a8861dfccc49e9a5d0282b9 100644 (file)
@@ -457,17 +457,17 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
        }
        else // RACE! Not Qualifying
        {
        }
        else // RACE! Not Qualifying
        {
-               float lself, lother, othtime;
+               float mylaps, lother, othtime;
                entity oth;
                oth = race_checkpoint_lastplayers[cp];
                if(oth)
                {
                entity oth;
                oth = race_checkpoint_lastplayers[cp];
                if(oth)
                {
-                       lself = PlayerScore_Add(e, SP_RACE_LAPS, 0);
+                       mylaps = PlayerScore_Add(e, SP_RACE_LAPS, 0);
                        lother = race_checkpoint_lastlaps[cp];
                        othtime = race_checkpoint_lasttimes[cp];
                }
                else
                        lother = race_checkpoint_lastlaps[cp];
                        othtime = race_checkpoint_lasttimes[cp];
                }
                else
-                       lself = lother = othtime = 0;
+                       mylaps = lother = othtime = 0;
 
                if(IS_REAL_CLIENT(e))
                {
 
                if(IS_REAL_CLIENT(e))
                {
@@ -485,7 +485,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                else
                                {
                                        WriteInt24_t(MSG_ONE, TIME_ENCODE(time - race_checkpoint_lasttimes[cp]));
                                else
                                {
                                        WriteInt24_t(MSG_ONE, TIME_ENCODE(time - race_checkpoint_lasttimes[cp]));
-                                       WriteByte(MSG_ONE, lself - lother);
+                                       WriteByte(MSG_ONE, mylaps - lother);
                                        WriteString(MSG_ONE, oth.netname); // record holder
                                }
                        });
                                        WriteString(MSG_ONE, oth.netname); // record holder
                                }
                        });
@@ -493,7 +493,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
 
                race_checkpoint_lastplayers[cp] = e;
                race_checkpoint_lasttimes[cp] = time;
 
                race_checkpoint_lastplayers[cp] = e;
                race_checkpoint_lasttimes[cp] = time;
-               race_checkpoint_lastlaps[cp] = lself;
+               race_checkpoint_lastlaps[cp] = mylaps;
 
                if(IS_REAL_CLIENT(oth))
                {
 
                if(IS_REAL_CLIENT(oth))
                {
@@ -511,7 +511,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                else
                                {
                                        WriteInt24_t(MSG_ONE, TIME_ENCODE(time - othtime));
                                else
                                {
                                        WriteInt24_t(MSG_ONE, TIME_ENCODE(time - othtime));
-                                       WriteByte(MSG_ONE, lother - lself);
+                                       WriteByte(MSG_ONE, lother - mylaps);
                                        WriteString(MSG_ONE, e.netname); // record holder
                                }
                        });
                                        WriteString(MSG_ONE, e.netname); // record holder
                                }
                        });
index 12b2e7daa60b980704fe4ae9f3e41a2a21a29717..c2bccef95ca571f7001648c5ed11ac8fac6180b9 100644 (file)
@@ -68,7 +68,7 @@ void CL_Weaponentity_Think(entity this)
        .entity weaponentity = this.weaponentity_fld;
        if (this.owner.(weaponentity) != this)
        {
        .entity weaponentity = this.weaponentity_fld;
        if (this.owner.(weaponentity) != this)
        {
-               // owner has new gun; remove self
+               // owner has new gun; remove old one
                if (this.weaponchild) remove(this.weaponchild);
                remove(this);
                return;
                if (this.weaponchild) remove(this.weaponchild);
                remove(this);
                return;