]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Purge WITHSELF from all non-engine functions
authorMario <mario@smbclan.net>
Fri, 10 Jun 2016 12:17:39 +0000 (22:17 +1000)
committerMario <mario@smbclan.net>
Fri, 10 Jun 2016 12:17:39 +0000 (22:17 +1000)
12 files changed:
qcsrc/common/weapons/weapon/hook.qc
qcsrc/server/cheats.qc
qcsrc/server/cheats.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_player.qh
qcsrc/server/command/cmd.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_subs.qc

index fd8fd9aefac325ad61d801c9615271e728268fad..5919611107dc32b01e2871e91c991092b9c61737 100644 (file)
@@ -266,7 +266,7 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity,
     {
         if (actor.hook)
             RemoveGrapplingHook(actor);
-        WITHSELF(actor, FireGrapplingHook());
+        FireGrapplingHook(actor);
         actor.hook_state &= ~HOOK_FIRING;
         actor.hook_refire = max(actor.hook_refire, time + autocvar_g_balance_grapplehook_refire * W_WeaponRateFactor(actor));
     }
index b9928f0b91213da871dbd68baacb0c3c7dd5f46f..94816a1a77d9606f33b8cb5a90a7131425ca2502 100644 (file)
@@ -33,7 +33,7 @@ void CopyBody(entity this, float keepvelocity);
 
 float CheatImpulse(entity this, int imp) { return 0; }
 float CheatCommand(entity this, int argc) { return 0; }
-float CheatFrame() { return 0; }
+float CheatFrame(entity this) { return 0; }
 void CheatInit() { cheatcount_total = world.cheatcount; }
 void CheatShutdown() { }
 void Drag_MoveDrag(entity from, entity to) { }
@@ -719,8 +719,8 @@ float Drag_IsDragging(entity dragger);
 void Drag_MoveDrag(entity from, entity to);
 .entity dragentity;
 
-float CheatFrame()
-{SELFPARAM();
+float CheatFrame(entity this)
+{
        BEGIN_CHEAT_FUNCTION();
 
        // Dragging can be used as either a cheat, or a function for some objects. If sv_cheats is active,
index e688f8c138c5de93f3404cd031d18c88bc5aacb5..1bf08064106c410874df00f9607d9222929ab1c0 100644 (file)
@@ -10,7 +10,7 @@ void CheatInit();
 void CheatShutdown();
 float CheatImpulse(entity this, int imp);
 float CheatCommand(entity this, int argc);
-float CheatFrame();
+float CheatFrame(entity this);
 
 const float CHRAME_DRAG = 8;
 
index 0c29aebebd621165cdb6f3797824c7ce0d65ab12..cc3a6028ec2ceeded767a7232a6dafe7689a7ae0 100644 (file)
@@ -177,7 +177,7 @@ void setplayermodel(entity e, string modelname)
 {
        precache_model(modelname);
        _setmodel(e, modelname);
-       player_setupanimsformodel();
+       player_setupanimsformodel(e);
        if(!autocvar_g_debug_globalsounds)
                UpdatePlayerSounds(e);
 }
@@ -442,7 +442,7 @@ void FixPlayermodel(entity player)
 /** Called when a client spawns in the server */
 void PutClientInServer()
 {
-       SELFPARAM();
+       SELFPARAM(); // needed for engine functions
        if (IS_BOT_CLIENT(this)) {
                TRANSMUTE(Player, this);
        } else if (IS_REAL_CLIENT(this)) {
@@ -733,7 +733,7 @@ SetChangeParms
 =============
 */
 void SetChangeParms ()
-{SELFPARAM();
+{SELFPARAM(); // needed for engine functions
        // save parms for level change
        parm1 = this.parm_idlesince - time;
 
@@ -784,8 +784,8 @@ void ClientKill_Now_TeamChange(entity this)
        this.killindicator_teamchange = 0;
 }
 
-void ClientKill_Now()
-{SELFPARAM();
+void ClientKill_Now(entity this)
+{
        if(this.vehicle)
        {
            vehicles_exit(this.vehicle, VHEF_RELEASE);
@@ -827,7 +827,7 @@ void KillIndicator_Think(entity this)
 
        if(this.cnt <= 0)
        {
-               WITHSELF(this.owner, ClientKill_Now());
+               ClientKill_Now(this.owner);
                return;
        }
     else if(g_cts && this.health == 1) // health == 1 means that it's silent
@@ -879,7 +879,7 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change,
 
                if(killtime <= 0 || !IS_PLAYER(this) || IS_DEAD(this))
                {
-                       WITHSELF(this, ClientKill_Now());
+                       ClientKill_Now(this);
                }
                else
                {
@@ -949,7 +949,7 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change,
 }
 
 void ClientKill ()
-{SELFPARAM();
+{SELFPARAM(); // needed for engine functions
        if(gameover) return;
        if(this.player_blocked) return;
        if(STAT(FROZEN, this)) return;
@@ -999,7 +999,7 @@ Called once (not at each match start) when a client begins a connection to the s
 =============
 */
 void ClientPreConnect ()
-{SELFPARAM();
+{SELFPARAM(); // needed for engine functions
        if(autocvar_sv_eventlog)
        {
                GameLogEcho(sprintf(":connect:%d:%d:%s",
@@ -1020,7 +1020,7 @@ Called when a client connects to the server
 */
 void ClientConnect()
 {
-       SELFPARAM();
+       SELFPARAM(); // needed for engine functions
        if (Ban_MaybeEnforceBanOnce(this)) return;
        assert(!IS_CLIENT(this), return);
        this.flags |= FL_CLIENT;
@@ -1177,7 +1177,7 @@ Called when a client disconnects from the server
 void ReadyCount();
 void ClientDisconnect()
 {
-       SELFPARAM();
+       SELFPARAM(); // needed for engine functions
        assert(IS_CLIENT(this), return);
 
        PlayerStats_GameReport_FinalizePlayer(this);
@@ -1247,8 +1247,8 @@ void ChatBubbleThink(entity this)
 
 }
 
-void UpdateChatBubble()
-{SELFPARAM();
+void UpdateChatBubble(entity this)
+{
        if (this.alpha < 0)
                return;
        // spawn a chatbubble entity if needed
@@ -1286,8 +1286,8 @@ void UpdateChatBubble()
        else this.colormod = '1 1 1';
 }*/
 
-void respawn()
-{SELFPARAM();
+void respawn(entity this)
+{
        if(this.alpha >= 0 && autocvar_g_respawn_ghosts)
        {
                this.solid = SOLID_NOT;
@@ -1307,8 +1307,8 @@ void respawn()
        PutClientInServer();
 }
 
-void play_countdown(float finished, Sound samp)
-{SELFPARAM();
+void play_countdown(entity this, float finished, Sound samp)
+{
     TC(Sound, samp);
        if(IS_REAL_CLIENT(this))
                if(floor(finished - time - frametime) != floor(finished - time))
@@ -1316,8 +1316,8 @@ void play_countdown(float finished, Sound samp)
                                sound (this, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
 }
 
-void player_powerups ()
-{SELFPARAM();
+void player_powerups(entity this)
+{
        // add a way to see what the items were BEFORE all of these checks for the mutator hook
        int items_prev = this.items;
 
@@ -1338,7 +1338,7 @@ void player_powerups ()
        {
                if (this.items & ITEM_Strength.m_itemid)
                {
-                       play_countdown(this.strength_finished, SND_POWEROFF);
+                       play_countdown(this, this.strength_finished, SND_POWEROFF);
                        this.effects = this.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
                        if (time > this.strength_finished)
                        {
@@ -1358,7 +1358,7 @@ void player_powerups ()
                }
                if (this.items & ITEM_Shield.m_itemid)
                {
-                       play_countdown(this.invincible_finished, SND_POWEROFF);
+                       play_countdown(this, this.invincible_finished, SND_POWEROFF);
                        this.effects = this.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
                        if (time > this.invincible_finished)
                        {
@@ -1391,7 +1391,7 @@ void player_powerups ()
                        }
                        else
                        {
-                               play_countdown(this.superweapons_finished, SND_POWEROFF);
+                               play_countdown(this, this.superweapons_finished, SND_POWEROFF);
                                if (time > this.superweapons_finished)
                                {
                                        this.items = this.items - (this.items & IT_SUPERWEAPON);
@@ -1479,8 +1479,8 @@ float CalcRotRegen(float current, float regenstable, float regenfactor, float re
        return current;
 }
 
-void player_regen ()
-{SELFPARAM();
+void player_regen(entity this)
+{
        float max_mod, regen_mod, rot_mod, limit_mod;
        max_mod = regen_mod = rot_mod = limit_mod = 1;
        regen_mod_max = max_mod;
@@ -1540,8 +1540,8 @@ void player_regen ()
 }
 
 bool zoomstate_set;
-void SetZoomState(float z)
-{SELFPARAM();
+void SetZoomState(entity this, float z)
+{
        if(z != this.zoomstate)
        {
                this.zoomstate = z;
@@ -1617,7 +1617,7 @@ void SpectateCopy(entity this, entity spectatee)
                this.fixangle = true;
        setorigin(this, spectatee.origin);
        setsize(this, spectatee.mins, spectatee.maxs);
-       SetZoomState(spectatee.zoomstate);
+       SetZoomState(this, spectatee.zoomstate);
 
     anticheat_spectatecopy(this, spectatee);
        this.hud = spectatee.hud;
@@ -1759,8 +1759,8 @@ ShowRespawnCountdown()
 Update a respawn countdown display.
 =============
 */
-void ShowRespawnCountdown()
-{SELFPARAM();
+void ShowRespawnCountdown(entity this)
+{
        float number;
        if(!IS_DEAD(this)) // just respawned?
                return;
@@ -1855,8 +1855,8 @@ bool nJoinAllowed(entity this, entity ignore)
  * Checks whether the client is an observer or spectator, if so, he will get kicked after
  * g_maxplayers_spectator_blocktime seconds
  */
-void checkSpectatorBlock()
-{SELFPARAM();
+void checkSpectatorBlock(entity this)
+{
        if(IS_SPEC(this) || IS_OBSERVER(this))
        if(!this.caplayer)
        if(IS_REAL_CLIENT(this))
@@ -2005,8 +2005,8 @@ void SpectatorThink(entity this)
 }
 
 void vehicles_enter (entity pl, entity veh);
-void PlayerUseKey()
-{SELFPARAM();
+void PlayerUseKey(entity this)
+{
        if (!IS_PLAYER(this))
                return;
 
@@ -2066,7 +2066,7 @@ Called every frame for each client before the physics are run
 .int items_added;
 void PlayerPreThink ()
 {
-    SELFPARAM();
+    SELFPARAM(); // needed for engine functions
        WarpZone_PlayerPhysics_FixVAngle(this);
 
     STAT(GAMESTARTTIME, this) = game_starttime;
@@ -2084,7 +2084,7 @@ void PlayerPreThink ()
        if (blockSpectators && frametime) {
                // WORKAROUND: only use dropclient in server frames (frametime set).
                // Never use it in cl_movement frames (frametime zero).
-               checkSpectatorBlock();
+               checkSpectatorBlock(this);
     }
 
        zoomstate_set = false;
@@ -2180,7 +2180,7 @@ void PlayerPreThink ()
        if(!this.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
        {
                if(PHYS_INPUT_BUTTON_USE(this) && !this.usekeypressed)
-                       PlayerUseKey();
+                       PlayerUseKey(this);
                this.usekeypressed = PHYS_INPUT_BUTTON_USE(this);
        }
 
@@ -2203,17 +2203,17 @@ void PlayerPreThink ()
                        this.fixangle = true;
                }
 
-               if (frametime) player_powerups();
+               if (frametime) player_powerups(this);
 
                if (IS_DEAD(this)) {
                        if (this.personal && g_race_qualifying) {
                                if (time > this.respawn_time) {
                                        STAT(RESPAWN_TIME, this) = this.respawn_time = time + 1; // only retry once a second
-                                       respawn();
+                                       respawn(this);
                                        this.impulse = CHIMPULSE_SPEEDRUN.impulse;
                                }
                        } else {
-                               if (frametime) player_anim();
+                               if (frametime) player_anim(this);
                                bool button_pressed = (PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this));
 
                                if (this.deadflag == DEAD_DYING) {
@@ -2240,7 +2240,7 @@ void PlayerPreThink ()
                                        }
                                }
 
-                               ShowRespawnCountdown();
+                               ShowRespawnCountdown(this);
 
                                if (this.respawn_flags & RESPAWN_SILENT)
                                        STAT(RESPAWN_TIME, this) = 0;
@@ -2309,14 +2309,14 @@ void PlayerPreThink ()
                        this.items |= this.items_added;
                }
 
-               player_regen();
+               player_regen(this);
 
                // WEAPONTODO: Add a weapon request for this
                // rot vortex charge to the charge limit
                if (WEP_CVAR(vortex, charge_rot_rate) && this.vortex_charge > WEP_CVAR(vortex, charge_limit) && this.vortex_charge_rottime < time)
                        this.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), this.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
 
-               if (frametime) player_anim();
+               if (frametime) player_anim(this);
 
                // secret status
                secrets_setstatus(this);
@@ -2339,7 +2339,7 @@ void PlayerPreThink ()
 
        // WEAPONTODO: Add weapon request for this
        if (!zoomstate_set) {
-               SetZoomState(
+               SetZoomState(this,
                        PHYS_INPUT_BUTTON_ZOOM(this) || PHYS_INPUT_BUTTON_ZOOMSCRIPT(this)
                        || (PHYS_INPUT_BUTTON_ATCK2(this) && PS(this).m_weapon == WEP_VORTEX)
                        || (PHYS_INPUT_BUTTON_ATCK2(this) && PS(this).m_weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)
@@ -2415,7 +2415,7 @@ Called every frame for each client after the physics are run
 .float idlekick_lasttimeleft;
 void PlayerPostThink ()
 {
-    SELFPARAM();
+    SELFPARAM(); // needed for engine functions
        if (sv_maxidle > 0)
        if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
        if (IS_REAL_CLIENT(this))
@@ -2450,14 +2450,14 @@ void PlayerPostThink ()
                }
        }
 
-       CheatFrame();
+       CheatFrame(this);
 
        //CheckPlayerJump();
 
        if (IS_PLAYER(this)) {
                DrownPlayer(this);
                CheckRules_Player(this);
-               UpdateChatBubble();
+               UpdateChatBubble(this);
                if (this.impulse) ImpulseCommands(this);
                if (intermission_running) return; // intermission or finale
                GetPressedKeys(this);
index 23ecb44c7e6b4ff4e012939182edf3f53554ebe9..6de25fa10f60d1af6e02a7e9aa1cfae344cf3ae0 100644 (file)
@@ -373,7 +373,7 @@ void ImpulseCommands(entity this)
 
 IMPULSE(use)
 {
-       PlayerUseKey();
+       PlayerUseKey(this);
 }
 
 IMPULSE(waypoint_personal_here)
index 3b04a492217d062c5188859dea37909cc8b612f3..250f3cda1a0113b5d168761688ce6f564647e063 100644 (file)
@@ -126,15 +126,15 @@ void CopyBody(entity this, float keepvelocity)
        animdecide_setframes(clone, false, frame, frame1time, frame2, frame2time);
 }
 
-void player_setupanimsformodel()
-{SELFPARAM();
+void player_setupanimsformodel(entity this)
+{
        // load animation info
-       animdecide_load_if_needed(self);
-       animdecide_setstate(self, 0, false);
+       animdecide_load_if_needed(this);
+       animdecide_setstate(this, 0, false);
 }
 
-void player_anim ()
-{SELFPARAM();
+void player_anim(entity this)
+{
        int deadbits = (this.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
        if(IS_DEAD(this)) {
                if (!deadbits) {
index 16637fe327415e86ff4f5205322008cf55451ec1..b5f8ca07c8d4a5dc81db14099d86f597405b2827 100644 (file)
@@ -9,9 +9,9 @@
 void CopyBody_Think(entity this);
 void CopyBody(entity this, float keepvelocity);
 
-void player_setupanimsformodel();
+void player_setupanimsformodel(entity this);
 
-void player_anim();
+void player_anim(entity this);
 
 void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 
index 9a9da4def69931db3ff207683570c67e0e540dd4..cf0b536d515438e844c11b7b4ac5c453aca767e9 100644 (file)
@@ -706,7 +706,7 @@ void ClientCommand_macro_write_aliases(float fh)
 
 void SV_ParseClientCommand(string command)
 {
-       SELFPARAM();
+       SELFPARAM(); // needed for engine functions
        // If invalid UTF-8, don't even parse it
        string command2 = "";
        float len = strlen(command);
index 8e5e8b34c4a0a10aeefc400a595208147c15bc38..e74a6923e87af661cb6380c053fed265a8bad0bb 100644 (file)
@@ -77,7 +77,7 @@ float server_is_dedicated;
 .float fade_time;
 .float fade_rate;
 
-void() player_setupanimsformodel;
+void player_setupanimsformodel(entity this);
 
 .string mdl;
 
index 2deab23d76309f527b3e0f535ead32d92e61efb2..7bb41c6d2b306e6875fb025a695787f1064b4765 100644 (file)
@@ -503,17 +503,17 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
 
 void Ice_Think(entity this)
 {
-       if(!STAT(FROZEN, self.owner) || self.owner.iceblock != self)
+       if(!STAT(FROZEN, this.owner) || this.owner.iceblock != this)
        {
-               remove(self);
+               remove(this);
                return;
        }
-       setorigin(self, self.owner.origin - '0 0 16');
-       self.nextthink = time;
+       setorigin(this, this.owner.origin - '0 0 16');
+       this.nextthink = time;
 }
 
 void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint)
-{SELFPARAM();
+{
        if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed
                return;
 
@@ -526,7 +526,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        targ.revive_progress = ((frozen_type == 3) ? 1 : 0);
        targ.health = ((frozen_type == 3) ? targ_maxhealth : 1);
        targ.revive_speed = freeze_time;
-       self.bot_attack = false;
+       targ.bot_attack = false;
 
        entity ice = new(ice);
        ice.owner = targ;
@@ -554,7 +554,6 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ)
 {
-    SELFPARAM();
        if(!STAT(FROZEN, targ))
                return;
 
@@ -564,7 +563,7 @@ void Unfreeze (entity targ)
        STAT(FROZEN, targ) = 0;
        targ.revive_progress = 0;
        targ.revival_time = time;
-       self.bot_attack = true;
+       targ.bot_attack = true;
 
        WaypointSprite_Kill(targ.waypointsprite_attached);
 
index 498d60267331dca88c12d100184b5ad2a9ada840..04766c155dd89ed8cbbfc862f423217c8d6994fe 100644 (file)
@@ -91,18 +91,18 @@ void GrapplingHookReset(entity this)
 }
 
 void GrapplingHookThink(entity this);
-void GrapplingHook_Stop()
-{SELFPARAM();
-       Send_Effect(EFFECT_HOOK_IMPACT, self.origin, '0 0 0', 1);
-       sound (self, CH_SHOTS, SND_HOOK_IMPACT, VOL_BASE, ATTEN_NORM);
-
-       self.state = 1;
-       setthink(self, GrapplingHookThink);
-       self.nextthink = time;
-       settouch(self, func_null);
-       self.velocity = '0 0 0';
-       self.movetype = MOVETYPE_NONE;
-       self.hook_length = -1;
+void GrapplingHook_Stop(entity this)
+{
+       Send_Effect(EFFECT_HOOK_IMPACT, this.origin, '0 0 0', 1);
+       sound (this, CH_SHOTS, SND_HOOK_IMPACT, VOL_BASE, ATTEN_NORM);
+
+       this.state = 1;
+       setthink(this, GrapplingHookThink);
+       this.nextthink = time;
+       settouch(this, func_null);
+       this.velocity = '0 0 0';
+       this.movetype = MOVETYPE_NONE;
+       this.hook_length = -1;
 }
 
 .vector hook_start, hook_end;
@@ -110,24 +110,24 @@ bool GrapplingHookSend(entity this, entity to, int sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_HOOK);
        sf = sf & 0x7F;
-       if(sound_allowed(MSG_BROADCAST, self.realowner))
+       if(sound_allowed(MSG_BROADCAST, this.realowner))
                sf |= 0x80;
        WriteByte(MSG_ENTITY, sf);
        if(sf & 1)
        {
-               WriteByte(MSG_ENTITY, etof(self.realowner));
+               WriteByte(MSG_ENTITY, etof(this.realowner));
        }
        if(sf & 2)
        {
-               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 & 4)
        {
-               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;
 }
@@ -307,7 +307,7 @@ void GrapplingHookTouch (entity this)
                return;
        PROJECTILE_TOUCH(this);
 
-       GrapplingHook_Stop();
+       GrapplingHook_Stop(this);
 
        if(other)
                if(other.movetype != MOVETYPE_NONE)
@@ -341,32 +341,32 @@ void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float
        }
 }
 
-void FireGrapplingHook ()
-{SELFPARAM();
+void FireGrapplingHook(entity actor)
+{
        entity missile;
        vector org;
        vector vs;
 
-       if(forbidWeaponUse(self)) return;
-       if(self.vehicle) return;
+       if(forbidWeaponUse(actor)) return;
+       if(actor.vehicle) return;
 
-       makevectors(self.v_angle);
+       makevectors(actor.v_angle);
 
-       int s = W_GetGunAlignment(self);
+       int s = W_GetGunAlignment(actor);
        vs = hook_shotorigin[s];
 
        // UGLY WORKAROUND: play this on CH_WEAPON_B so it can't cut off fire sounds
-       sound (self, CH_WEAPON_B, SND_HOOK_FIRE, VOL_BASE, ATTEN_NORM);
-       org = self.origin + self.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
+       sound (actor, CH_WEAPON_B, SND_HOOK_FIRE, VOL_BASE, ATTEN_NORM);
+       org = actor.origin + actor.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
 
-       tracebox(self.origin + self.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, self);
+       tracebox(actor.origin + actor.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, actor);
        org = trace_endpos;
 
        Send_Effect(EFFECT_HOOK_MUZZLEFLASH, org, '0 0 0', 1);
 
-       missile = WarpZone_RefSys_SpawnSameRefSys(self);
-       missile.owner = missile.realowner = self;
-       self.hook = missile;
+       missile = WarpZone_RefSys_SpawnSameRefSys(actor);
+       missile.owner = missile.realowner = actor;
+       actor.hook = missile;
        missile.reset = GrapplingHookReset;
        missile.classname = "grapplinghook";
        missile.flags = FL_PROJECTILE;
index 2134278a2b1027c71c63e3514814c6a79c98683f..3fb232f02f58ed683fe27c22b84091a02e1bf4b5 100644 (file)
@@ -326,8 +326,8 @@ void LODmodel_attach(entity this)
 }
 
 void ApplyMinMaxScaleAngles(entity e)
-{SELFPARAM();
-       if(e.angles.x != 0 || e.angles.z != 0 || self.avelocity.x != 0 || self.avelocity.z != 0) // "weird" rotation
+{
+       if(e.angles.x != 0 || e.angles.z != 0 || e.avelocity.x != 0 || e.avelocity.z != 0) // "weird" rotation
        {
                e.maxs = '1 1 1' * vlen(
                        '1 0 0' * max(-e.mins.x, e.maxs.x) +
@@ -336,7 +336,7 @@ void ApplyMinMaxScaleAngles(entity e)
                );
                e.mins = -e.maxs;
        }
-       else if(e.angles.y != 0 || self.avelocity.y != 0) // yaw only is a bit better
+       else if(e.angles.y != 0 || e.avelocity.y != 0) // yaw only is a bit better
        {
                e.maxs_x = vlen(
                        '1 0 0' * max(-e.mins.x, e.maxs.x) +