]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Clean out some waypoint sprite SELFPARAMs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index ad9a1ec542cc085844f77e1905f337da70f29a59..d826c2a35f7e72c9b949cca84b549824f58ee80a 100644 (file)
@@ -187,7 +187,7 @@ void FixPlayermodel(entity player);
 void PutObserverInServer()
 {
        SELFPARAM();
-    bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver);
+    bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
        PlayerState_detach(this);
 
        if (IS_PLAYER(this) && this.health >= 1) {
@@ -385,8 +385,8 @@ void FixPlayermodel(entity player)
        }
 
        MUTATOR_CALLHOOK(FixPlayermodel, defaultmodel, defaultskin);
-       defaultmodel = ret_string;
-       defaultskin = ret_int;
+       defaultmodel = M_ARGV(0, string);
+       defaultskin = M_ARGV(1, int);
 
        bool chmdl = false;
        int oldskin;
@@ -635,7 +635,7 @@ void PutClientInServer()
 
                Unfreeze(this);
 
-               MUTATOR_CALLHOOK(PlayerSpawn, spot);
+               MUTATOR_CALLHOOK(PlayerSpawn, this, spot);
 
                if (autocvar_spawn_debug)
                {
@@ -851,8 +851,8 @@ void KillIndicator_Think(entity this)
 }
 
 float clientkilltime;
-void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 = spec
-{SELFPARAM();
+void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change, -1 = auto, -2 = spec
+{
        float killtime;
        float starttime;
        entity e;
@@ -880,7 +880,7 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
 
                if(killtime <= 0 || !IS_PLAYER(this) || IS_DEAD(this))
                {
-                       ClientKill_Now();
+                       WITHSELF(this, ClientKill_Now());
                }
                else
                {
@@ -955,7 +955,7 @@ void ClientKill ()
        if(this.player_blocked) return;
        if(STAT(FROZEN, this)) return;
 
-       ClientKill_TeamChange(0);
+       ClientKill_TeamChange(this, 0);
 }
 
 void FixClientCvars(entity e)
@@ -1162,7 +1162,7 @@ void ClientConnect()
                sv_notice_join(this);
 
        FOREACH_ENTITY_FLOAT(init_for_player_needed, true, {
-               WITHSELF(it, it.init_for_player(it));
+               it.init_for_player(it, this);
        });
 
        MUTATOR_CALLHOOK(ClientConnect, this);
@@ -1191,7 +1191,7 @@ void ClientDisconnect()
 
        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_DISCONNECT, this.netname);
 
-    MUTATOR_CALLHOOK(ClientDisconnect);
+    MUTATOR_CALLHOOK(ClientDisconnect, this);
 
        ClientState_detach(this);
 
@@ -1208,7 +1208,7 @@ void ClientDisconnect()
        if (this.chatbubbleentity) remove(this.chatbubbleentity);
        if (this.killindicator) remove(this.killindicator);
 
-       WaypointSprite_PlayerGone();
+       WaypointSprite_PlayerGone(this);
 
        bot_relinkplayerlist();
 
@@ -1551,10 +1551,9 @@ void SetZoomState(float z)
        zoomstate_set = true;
 }
 
-void GetPressedKeys()
+void GetPressedKeys(entity this)
 {
-       SELFPARAM();
-       MUTATOR_CALLHOOK(GetPressedKeys);
+       MUTATOR_CALLHOOK(GetPressedKeys, this);
        int keys = this.pressedkeys;
        keys = BITSET(keys, KEY_FORWARD,        this.movement.x > 0);
        keys = BITSET(keys, KEY_BACKWARD,       this.movement.x < 0);
@@ -1698,7 +1697,7 @@ bool Spectate(entity pl)
 {SELFPARAM();
        if(MUTATOR_CALLHOOK(SpectateSet, this, pl))
                return false;
-       pl = spec_player;
+       pl = M_ARGV(1, entity);
 
        SetSpectatee(this, pl);
        return SpectateSet();
@@ -1709,7 +1708,7 @@ bool SpectateNext()
        other = find(this.enemy, classname, STR_PLAYER);
 
        if (MUTATOR_CALLHOOK(SpectateNext, this, other))
-               other = spec_player;
+               other = M_ARGV(1, entity);
        else if (!other)
                other = find(other, classname, STR_PLAYER);
 
@@ -1734,10 +1733,10 @@ bool SpectatePrev()
        switch (MUTATOR_CALLHOOK(SpectatePrev, this, other, first))
        {
                case MUT_SPECPREV_FOUND:
-                   other = spec_player;
+                   other = M_ARGV(1, entity);
                    break;
                case MUT_SPECPREV_RETURN:
-                   other = spec_player;
+                   other = M_ARGV(1, entity);
                    return true;
                case MUT_SPECPREV_CONTINUE:
                default:
@@ -2052,7 +2051,7 @@ void PlayerUseKey()
        }
 
        // a use key was pressed; call handlers
-       MUTATOR_CALLHOOK(PlayerUseKey);
+       MUTATOR_CALLHOOK(PlayerUseKey, this);
 }
 
 
@@ -2153,7 +2152,7 @@ void PlayerPreThink ()
                        Unfreeze(this);
        }
 
-       MUTATOR_CALLHOOK(PlayerPreThink);
+       MUTATOR_CALLHOOK(PlayerPreThink, this);
 
        if(autocvar_g_vehicles_enter)
        if(time > this.last_vehiclecheck)
@@ -2321,7 +2320,7 @@ void PlayerPreThink ()
                if (frametime) player_anim();
 
                // secret status
-               secrets_setstatus();
+               secrets_setstatus(this);
 
                // monsters status
                monsters_setstatus(this);
@@ -2462,7 +2461,7 @@ void PlayerPostThink ()
                UpdateChatBubble();
                if (this.impulse) ImpulseCommands(this);
                if (intermission_running) return; // intermission or finale
-               GetPressedKeys();
+               GetPressedKeys(this);
        }
 
        if (this.waypointsprite_attachedforcarrier) {
@@ -2470,7 +2469,7 @@ void PlayerPostThink ()
                WaypointSprite_UpdateHealth(this.waypointsprite_attachedforcarrier, '1 0 0' * v);
     }
 
-       playerdemo_write();
+       playerdemo_write(this);
 
        CSQCMODEL_AUTOUPDATE(this);
 }